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
This commit is contained in:
dyedgreen
2016-06-26 09:48:07 +02:00
parent a81e8356b4
commit 5369287ea8
3 changed files with 15 additions and 4 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
{ {
"name": "pebble-directions", "name": "pebble-directions",
"author": "Dyedgreen", "author": "Dyedgreen",
"version": "1.0.0", "version": "1.1.0",
"keywords": ["pebble-app"], "keywords": ["navigation", "maps", "directions"],
"private": true, "private": true,
"dependencies": {}, "dependencies": {},
"pebble": { "pebble": {
+3 -1
View File
@@ -14,7 +14,7 @@ GRect directions_draw_more_indicator(GContext *ctx, GRect bounds) {
// Draw the background // Draw the background
graphics_context_set_fill_color(ctx, color_bg); 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) // Draw the arrow (draws a path)
struct GPathInfo path_arrow_info = { struct GPathInfo path_arrow_info = {
.num_points = 3, .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); 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(); GTextAttributes *text_attributes = graphics_text_attributes_create();
graphics_text_attributes_enable_screen_text_flow(text_attributes, 7); 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_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_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); 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); GRect text_box = GRect(0, 67, bounds.size.w, bounds.size.h - 74);
GTextAttributes *text_attributes = graphics_text_attributes_create(); GTextAttributes *text_attributes = graphics_text_attributes_create();
graphics_text_attributes_enable_screen_text_flow(text_attributes, 7); 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_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_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); graphics_text_attributes_destroy(text_attributes);
+10 -1
View File
@@ -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 * // * APP MESSAGE STUFF *
@@ -464,7 +473,7 @@ void directions_window_push() {
window_stack_push(window, true); window_stack_push(window, true);
// Start the dictation session // Start the dictation session
dictation_session_start(dictation_session); dictation_session_start_handler();
// Open the connection to the phone // Open the connection to the phone
app_message_start(); app_message_start();