From 5369287ea82aed1217d01a2b7aed3c5ace6b7266 Mon Sep 17 00:00:00 2001 From: dyedgreen Date: Sun, 26 Jun 2016 09:48:07 +0200 Subject: [PATCH] fixed a few ui bugs * Fixed a bug where an empty navigation view could be shown * Fixed a bug where the more indicator would reveal white space on round * Fixed a bug where the text would reflow on round * Included more relevant keywords in the package.json --- package.json | 4 ++-- src/directions_draw.c | 4 +++- src/directions_window.c | 11 ++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c73bcd4..b3014ae 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "pebble-directions", "author": "Dyedgreen", - "version": "1.0.0", - "keywords": ["pebble-app"], + "version": "1.1.0", + "keywords": ["navigation", "maps", "directions"], "private": true, "dependencies": {}, "pebble": { diff --git a/src/directions_draw.c b/src/directions_draw.c index 80912ba..1195369 100644 --- a/src/directions_draw.c +++ b/src/directions_draw.c @@ -14,7 +14,7 @@ GRect directions_draw_more_indicator(GContext *ctx, GRect bounds) { // Draw the background graphics_context_set_fill_color(ctx, color_bg); - graphics_fill_rect(ctx, GRect(0, bounds.size.h - 17, bounds.size.w, 17), 0, GCornerNone); + graphics_fill_rect(ctx, GRect(0, bounds.size.h - 17, bounds.size.w, 25), 0, GCornerNone); // Draw the arrow (draws a path) struct GPathInfo path_arrow_info = { .num_points = 3, @@ -80,6 +80,7 @@ void directions_draw_summary(GContext *ctx, GRect bounds, GColor color, int dist GRect address_box = GRect(0, 7 + bounds.size.h / 2, bounds.size.w, bounds.size.h / 2 - 14); GTextAttributes *text_attributes = graphics_text_attributes_create(); graphics_text_attributes_enable_screen_text_flow(text_attributes, 7); + graphics_text_attributes_enable_paging(text_attributes, address_box.origin, address_box); graphics_context_set_text_color(ctx, color); graphics_draw_text(ctx, string_address, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD), address_box, GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, text_attributes); graphics_text_attributes_destroy(text_attributes); @@ -138,6 +139,7 @@ void directions_draw_step(GContext *ctx, GRect bounds, GColor color, char *text, GRect text_box = GRect(0, 67, bounds.size.w, bounds.size.h - 74); GTextAttributes *text_attributes = graphics_text_attributes_create(); graphics_text_attributes_enable_screen_text_flow(text_attributes, 7); + graphics_text_attributes_enable_paging(text_attributes, text_box.origin, text_box); graphics_context_set_text_color(ctx, color_text); graphics_draw_text(ctx, text, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD), text_box, GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, text_attributes); graphics_text_attributes_destroy(text_attributes); diff --git a/src/directions_window.c b/src/directions_window.c index e8fa7c7..d840820 100644 --- a/src/directions_window.c +++ b/src/directions_window.c @@ -135,6 +135,15 @@ static void dictation_session_callback(DictationSession *session, DictationSessi } } +static void dictation_session_start_handler() { + // Start the dictation session and handel all possible errors + DictationSessionStatus dictation_status = dictation_session_start(dictation_session); + if (dictation_status != DictationSessionStatusSuccess) { + // Display error + window_display_error(Network); + } +} + // ********************* // * APP MESSAGE STUFF * @@ -464,7 +473,7 @@ void directions_window_push() { window_stack_push(window, true); // Start the dictation session - dictation_session_start(dictation_session); + dictation_session_start_handler(); // Open the connection to the phone app_message_start();