Skip to content
This repository was archived by the owner on Apr 27, 2020. It is now read-only.

Commit 1013900

Browse files
committed
Fixed crash on settings change on Diorite hardware
1 parent 489e80b commit 1013900

5 files changed

+30
-28
lines changed

package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
"projectType": "native",
3535
"resources": {
3636
"media": [
37+
{
38+
"file": "images/update.png",
39+
"name": "UPDATE_ICON",
40+
"targetPlatforms": null,
41+
"type": "bitmap"
42+
},
43+
{
44+
"file": "images/icon.png",
45+
"menuIcon": true,
46+
"name": "icon",
47+
"storageFormat": "png",
48+
"targetPlatforms": null,
49+
"type": "bitmap"
50+
},
3751
{
3852
"file": "images/alarm.png",
3953
"name": "ALARM_BITMAP",
@@ -43,10 +57,8 @@
4357
"type": "bitmap"
4458
},
4559
{
46-
"file": "images/achievement-complete_large.png",
47-
"memoryFormat": "Smallest",
48-
"name": "ACHIEVEMENT_COMPLETE_BITMAP",
49-
"spaceOptimization": "memory",
60+
"file": "images/achievement-incomplete.png",
61+
"name": "ACHIEVEMENT_INCOMPLETE_ICON",
5062
"targetPlatforms": [
5163
"basalt",
5264
"chalk",
@@ -56,8 +68,8 @@
5668
"type": "bitmap"
5769
},
5870
{
59-
"file": "images/achievement-incomplete.png",
60-
"name": "ACHIEVEMENT_INCOMPLETE_ICON",
71+
"file": "images/achievement-complete.png",
72+
"name": "ACHIEVEMENT_COMPLETE_ICON",
6173
"targetPlatforms": [
6274
"basalt",
6375
"chalk",
@@ -67,22 +79,10 @@
6779
"type": "bitmap"
6880
},
6981
{
70-
"file": "images/update.png",
71-
"name": "UPDATE_ICON",
72-
"targetPlatforms": null,
73-
"type": "bitmap"
74-
},
75-
{
76-
"file": "images/icon.png",
77-
"menuIcon": true,
78-
"name": "icon",
79-
"storageFormat": "png",
80-
"targetPlatforms": null,
81-
"type": "bitmap"
82-
},
83-
{
84-
"file": "images/achievement-complete.png",
85-
"name": "ACHIEVEMENT_COMPLETE_ICON",
82+
"file": "images/achievement-complete_large.png",
83+
"memoryFormat": "Smallest",
84+
"name": "ACHIEVEMENT_COMPLETE_BITMAP",
85+
"spaceOptimization": "memory",
8686
"targetPlatforms": [
8787
"basalt",
8888
"chalk",
@@ -123,5 +123,5 @@
123123
"watchface": false
124124
}
125125
},
126-
"version": "2.4.0"
126+
"version": "2.40.0"
127127
}

src/c/achievement.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void achievement_request_achievements() {
178178
}
179179

180180
void achievement_send_achievements() {
181-
// First, create dictionary with all the settings
181+
// First, create dictionary with all the achievements
182182

183183
// Iterator variable, keeps the state of the creation serialization process:
184184
DictionaryIterator *iter;

src/c/achievement_window.c

+2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ void achievement_window_push(char *achievement_name, char *achievement_descripti
169169
s_achievement_name = achievement_name;
170170
s_achievement_description = achievement_description;
171171

172+
#if !PBL_PLATFORM_DIORITE
172173
// Create sequence from PDC
173174
s_command_seq = gdraw_command_sequence_create_with_resource(RESOURCE_ID_ACHIEVEMENT_SEQUENCE);
175+
#endif
174176

175177
if (s_command_seq) {
176178
APP_LOG(APP_LOG_LEVEL_DEBUG, "The command sequence was successfully created.");

src/c/new_version_window.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void background_update_proc(Layer *layer, GContext *ctx) {
3535
}
3636

3737
static void text_background_update_proc(Layer *layer, GContext *ctx) {
38-
graphics_context_set_fill_color(ctx, PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite));
38+
graphics_context_set_fill_color(ctx, settings_get_backgroundColor());
3939
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, 0);
4040
}
4141

@@ -94,7 +94,7 @@ static void window_load(Window *window) {
9494
text_layer_set_background_color(s_label_layer, GColorClear);
9595
text_layer_set_text_alignment(s_label_layer, PBL_IF_ROUND_ELSE(GTextAlignmentCenter, GTextAlignmentLeft));
9696
text_layer_set_font(s_label_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));
97-
text_layer_set_text_color(s_label_layer, gcolor_legible_over(PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite)));
97+
text_layer_set_text_color(s_label_layer, gcolor_legible_over(settings_get_backgroundColor()));
9898

9999
scroll_layer_add_child(s_scroll_layer, text_layer_get_layer(s_label_layer));
100100
layer_add_child(window_layer, scroll_layer_get_layer(s_scroll_layer));
@@ -108,7 +108,7 @@ static void window_load(Window *window) {
108108
layer_add_child(window_layer, s_indicator_down_layer);
109109

110110
GColor background_color = settings_get_backgroundColor();
111-
GColor foreground_color = gcolor_legible_over(PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite));
111+
GColor foreground_color = gcolor_legible_over(settings_get_backgroundColor());
112112

113113
const ContentIndicatorConfig up_config = (ContentIndicatorConfig) {
114114
.layer = s_indicator_up_layer,

src/c/settings_menu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void menu_draw_row_callback(GContext* ctx, const Layer *cell_layer, MenuI
206206
case 5: // This is the about section
207207
switch (cell_index->row) {
208208
case 0: // This is the version number
209-
menu_cell_basic_draw(ctx, cell_layer, localize_get_version_row_title(), "v2.4, 2017-07-01", NULL);
209+
menu_cell_basic_draw(ctx, cell_layer, localize_get_version_row_title(), "v2.4, 2017-09-01", NULL);
210210
break;
211211
case 1: // This is the credits
212212
menu_cell_basic_draw(ctx, cell_layer, localize_get_credits_row_title(), "cheeseisdisgusting", NULL);

0 commit comments

Comments
 (0)