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

Commit

Permalink
Fixed crash on settings change on Diorite hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronhktan committed Sep 2, 2017
1 parent 489e80b commit 1013900
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@
"projectType": "native",
"resources": {
"media": [
{
"file": "images/update.png",
"name": "UPDATE_ICON",
"targetPlatforms": null,
"type": "bitmap"
},
{
"file": "images/icon.png",
"menuIcon": true,
"name": "icon",
"storageFormat": "png",
"targetPlatforms": null,
"type": "bitmap"
},
{
"file": "images/alarm.png",
"name": "ALARM_BITMAP",
Expand All @@ -43,10 +57,8 @@
"type": "bitmap"
},
{
"file": "images/achievement-complete_large.png",
"memoryFormat": "Smallest",
"name": "ACHIEVEMENT_COMPLETE_BITMAP",
"spaceOptimization": "memory",
"file": "images/achievement-incomplete.png",
"name": "ACHIEVEMENT_INCOMPLETE_ICON",
"targetPlatforms": [
"basalt",
"chalk",
Expand All @@ -56,8 +68,8 @@
"type": "bitmap"
},
{
"file": "images/achievement-incomplete.png",
"name": "ACHIEVEMENT_INCOMPLETE_ICON",
"file": "images/achievement-complete.png",
"name": "ACHIEVEMENT_COMPLETE_ICON",
"targetPlatforms": [
"basalt",
"chalk",
Expand All @@ -67,22 +79,10 @@
"type": "bitmap"
},
{
"file": "images/update.png",
"name": "UPDATE_ICON",
"targetPlatforms": null,
"type": "bitmap"
},
{
"file": "images/icon.png",
"menuIcon": true,
"name": "icon",
"storageFormat": "png",
"targetPlatforms": null,
"type": "bitmap"
},
{
"file": "images/achievement-complete.png",
"name": "ACHIEVEMENT_COMPLETE_ICON",
"file": "images/achievement-complete_large.png",
"memoryFormat": "Smallest",
"name": "ACHIEVEMENT_COMPLETE_BITMAP",
"spaceOptimization": "memory",
"targetPlatforms": [
"basalt",
"chalk",
Expand Down Expand Up @@ -123,5 +123,5 @@
"watchface": false
}
},
"version": "2.4.0"
"version": "2.40.0"
}
2 changes: 1 addition & 1 deletion src/c/achievement.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void achievement_request_achievements() {
}

void achievement_send_achievements() {
// First, create dictionary with all the settings
// First, create dictionary with all the achievements

// Iterator variable, keeps the state of the creation serialization process:
DictionaryIterator *iter;
Expand Down
2 changes: 2 additions & 0 deletions src/c/achievement_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ void achievement_window_push(char *achievement_name, char *achievement_descripti
s_achievement_name = achievement_name;
s_achievement_description = achievement_description;

#if !PBL_PLATFORM_DIORITE
// Create sequence from PDC
s_command_seq = gdraw_command_sequence_create_with_resource(RESOURCE_ID_ACHIEVEMENT_SEQUENCE);
#endif

if (s_command_seq) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "The command sequence was successfully created.");
Expand Down
6 changes: 3 additions & 3 deletions src/c/new_version_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void background_update_proc(Layer *layer, GContext *ctx) {
}

static void text_background_update_proc(Layer *layer, GContext *ctx) {
graphics_context_set_fill_color(ctx, PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite));
graphics_context_set_fill_color(ctx, settings_get_backgroundColor());
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, 0);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ static void window_load(Window *window) {
text_layer_set_background_color(s_label_layer, GColorClear);
text_layer_set_text_alignment(s_label_layer, PBL_IF_ROUND_ELSE(GTextAlignmentCenter, GTextAlignmentLeft));
text_layer_set_font(s_label_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));
text_layer_set_text_color(s_label_layer, gcolor_legible_over(PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite)));
text_layer_set_text_color(s_label_layer, gcolor_legible_over(settings_get_backgroundColor()));

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

GColor background_color = settings_get_backgroundColor();
GColor foreground_color = gcolor_legible_over(PBL_IF_COLOR_ELSE(settings_get_backgroundColor(), GColorWhite));
GColor foreground_color = gcolor_legible_over(settings_get_backgroundColor());

const ContentIndicatorConfig up_config = (ContentIndicatorConfig) {
.layer = s_indicator_up_layer,
Expand Down
2 changes: 1 addition & 1 deletion src/c/settings_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void menu_draw_row_callback(GContext* ctx, const Layer *cell_layer, MenuI
case 5: // This is the about section
switch (cell_index->row) {
case 0: // This is the version number
menu_cell_basic_draw(ctx, cell_layer, localize_get_version_row_title(), "v2.4, 2017-07-01", NULL);
menu_cell_basic_draw(ctx, cell_layer, localize_get_version_row_title(), "v2.4, 2017-09-01", NULL);
break;
case 1: // This is the credits
menu_cell_basic_draw(ctx, cell_layer, localize_get_credits_row_title(), "cheeseisdisgusting", NULL);
Expand Down

0 comments on commit 1013900

Please sign in to comment.