diff --git a/appinfo.json b/appinfo.json index 9768f49..304d894 100644 --- a/appinfo.json +++ b/appinfo.json @@ -1,123 +1,124 @@ { - "appKeys": { - "bg": 1, - "dlta": 4, - "icon": 0, - "name": 6, - "tapp": 3, - "tcgm": 2, - "ubat": 5 - }, - "capabilities": [ - ], - "companyName": "Nightscout Contributors", - "longName": "xDrip Watch Face", - "projectType": "native", - "resources": { - "media": [ - { - "file": "images/up.png", - "name": "IMAGE_UP", - "type": "png" - }, - { - "file": "images/upup.png", - "name": "IMAGE_UPUP", - "type": "png" - }, - { - "file": "images/up45.png", - "name": "IMAGE_UP45", - "type": "png" - }, - { - "file": "images/flat.png", - "name": "IMAGE_FLAT", - "type": "png" - }, - { - "file": "images/down.png", - "name": "IMAGE_DOWN", - "type": "png" - }, - { - "file": "images/downdown.png", - "name": "IMAGE_DOWNDOWN", - "type": "png" - }, - { - "file": "images/down45.png", - "name": "IMAGE_DOWN45", - "type": "png" - }, - { - "file": "images/none.png", - "name": "IMAGE_NONE", - "type": "png" - }, - { - "file": "images/logo.png", - "name": "IMAGE_LOGO", - "type": "png" - }, - { - "file": "images/menuicon.png", - "menuIcon": true, - "name": "IMAGE_MENU_ICON", - "type": "png" - }, - { - "file": "images/brokenantenna.png", - "name": "IMAGE_BROKEN_ANTENNA", - "type": "png" - }, - { - "file": "images/blooddrop.png", - "name": "IMAGE_BLOOD_DROP", - "type": "png" - }, - { - "file": "images/stoplight.png", - "name": "IMAGE_STOP_LIGHT", - "type": "png" - }, - { - "file": "images/hourglass.png", - "name": "IMAGE_HOURGLASS", - "type": "png" - }, - { - "file": "images/questionmarks.png", - "name": "IMAGE_QUESTION_MARKS", - "type": "png" - }, - { - "file": "images/phoneon.png", - "name": "IMAGE_PHONEON", - "type": "png" - }, - { - "file": "images/phoneoff.png", - "name": "IMAGE_PHONEOFF", - "type": "png" - }, - { - "file": "images/err.png", - "name": "IMAGE_ERR", - "type": "png" - } - ] - }, - "shortName": "xDrip Watch Face", - "uuid": "79f8ecb3-7214-4bfc-b996-cb95148ee6d3", - "versionCode": 1, - "versionLabel": "1.4", - "watchapp": { - "watchface": true - }, - "targetPlatforms": [ - "aplite", - "basalt" - ], - "sdkVersion": "3" + "appKeys": { + "bg": 1, + "dlta": 4, + "icon": 0, + "name": 6, + "tapp": 3, + "tcgm": 2, + "ubat": 5 + }, + "capabilities": [ + "" + ], + "companyName": "Nightscout Contributors", + "longName": "xDrip Pebble", + "projectType": "native", + "resources": { + "media": [ + { + "file": "images/menuicon.png", + "menuIcon": true, + "name": "IMAGE_MENU_ICON", + "type": "png" + }, + { + "file": "images/up.png", + "name": "IMAGE_UP", + "type": "png" + }, + { + "file": "images/upup.png", + "name": "IMAGE_UPUP", + "type": "png" + }, + { + "file": "images/up45.png", + "name": "IMAGE_UP45", + "type": "png" + }, + { + "file": "images/stoplight.png", + "name": "IMAGE_STOP_LIGHT", + "type": "png" + }, + { + "file": "images/questionmarks.png", + "name": "IMAGE_QUESTION_MARKS", + "type": "png" + }, + { + "file": "images/phoneon.png", + "name": "IMAGE_PHONEON", + "type": "png" + }, + { + "file": "images/phoneoff.png", + "name": "IMAGE_PHONEOFF", + "type": "png" + }, + { + "file": "images/none.png", + "name": "IMAGE_NONE", + "type": "png" + }, + { + "file": "images/logo.png", + "name": "IMAGE_LOGO", + "type": "png" + }, + { + "file": "images/hourglass.png", + "name": "IMAGE_HOURGLASS", + "type": "png" + }, + { + "file": "images/flat.png", + "name": "IMAGE_FLAT", + "type": "png" + }, + { + "file": "images/err.png", + "name": "IMAGE_ERR", + "type": "png" + }, + { + "file": "images/down.png", + "name": "IMAGE_DOWN", + "type": "png" + }, + { + "file": "images/downdown.png", + "name": "IMAGE_DOWNDOWN", + "type": "png" + }, + { + "file": "images/down45.png", + "name": "IMAGE_DOWN45", + "type": "png" + }, + { + "file": "images/brokenantenna.png", + "name": "IMAGE_BROKEN_ANTENNA", + "type": "png" + }, + { + "file": "images/blooddrop.png", + "name": "IMAGE_BLOOD_DROP", + "type": "png" + } + ] + }, + "sdkVersion": "3", + "shortName": "xDrip Pebble", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk" + ], + "uuid": "79f8ecb3-7214-4bfc-b996-cb95148ee6d3", + "versionLabel": "1.5", + "watchapp": { + "watchface": true + } } diff --git a/src/xdrip.c b/src/xdrip.c index d491b4f..93d0002 100644 --- a/src/xdrip.c +++ b/src/xdrip.c @@ -1497,7 +1497,7 @@ static void load_bg_delta() { if (strcmp(current_bg_delta, "LOAD") == 0) { strncpy(formatted_bg_delta, "LOADING...", MSGLAYER_BUFFER_SIZE); text_layer_set_text(message_layer, formatted_bg_delta); - text_layer_set_text(bg_layer, " "); + text_layer_set_text(bg_layer, "5.5"); create_update_bitmap(&icon_bitmap,icon_layer,SPECIAL_VALUE_ICONS[LOGO_SPECVALUE_ICON_INDX]); specvalue_alert = false; return; @@ -1885,7 +1885,10 @@ void window_load_cgm(Window *window_cgm) { window_layer_cgm = window_get_root_layer(window_cgm); // DELTA BG - #ifdef PBL_COLOR + #ifdef PBL_ROUND + message_layer = text_layer_create(GRect(0, 33, 180, 50)); + text_layer_set_font(message_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD)); + #elif PBL_COLOR message_layer = text_layer_create(GRect(0, 33, 144, 50)); text_layer_set_text_color(message_layer, GColorDukeBlue); text_layer_set_background_color(message_layer, GColorWhite); @@ -1900,23 +1903,58 @@ void window_load_cgm(Window *window_cgm) { layer_add_child(window_layer_cgm, text_layer_get_layer(message_layer)); // ARROW OR SPECIAL VALUE - icon_layer = bitmap_layer_create(GRect(85, -7, 78, 50)); - bitmap_layer_set_alignment(icon_layer, GAlignTopLeft); - bitmap_layer_set_background_color(icon_layer, GColorWhite); + // icon_layer = bitmap_layer_create(GRect(85, -7, 78, 50)); + // bitmap_layer_set_alignment(icon_layer, GAlignTopLeft); + #ifdef PBL_ROUND + icon_layer = bitmap_layer_create(GRect(120, 30, 78, 50)); + bitmap_layer_set_alignment(icon_layer, GAlignTopLeft); + #else + icon_layer = bitmap_layer_create(GRect(85, -7, 78, 50)); + bitmap_layer_set_alignment(icon_layer, GAlignTopLeft); + #endif + bitmap_layer_set_background_color(icon_layer, GColorWhite); layer_add_child(window_layer_cgm, bitmap_layer_get_layer(icon_layer)); // APP TIME AGO ICON - #ifdef PBL_COLOR + #ifdef PBL_ROUND + appicon_layer = bitmap_layer_create(GRect(90, 63, 40, 24)); + bitmap_layer_set_background_color(appicon_layer, GColorBlack); + #elif PBL_COLOR appicon_layer = bitmap_layer_create(GRect(118, 63, 40, 24)); + bitmap_layer_set_background_color(appicon_layer, GColorWhite); #else appicon_layer = bitmap_layer_create(GRect(118, 63, 40, 24)); + bitmap_layer_set_background_color(appicon_layer, GColorWhite); #endif bitmap_layer_set_alignment(appicon_layer, GAlignLeft); - bitmap_layer_set_background_color(appicon_layer, GColorWhite); + // bitmap_layer_set_background_color(appicon_layer, GColorWhite); layer_add_child(window_layer_cgm, bitmap_layer_get_layer(appicon_layer)); - + + //KW TODO: move BG section to here maybe? + // BG + #ifdef PBL_ROUND + bg_layer = text_layer_create(GRect(0, -7, 180, 47)); + text_layer_set_text_color(bg_layer, GColorDukeBlue); + text_layer_set_background_color(bg_layer, GColorWhite); + #elif PBL_COLOR + bg_layer = text_layer_create(GRect(0, -5, 95, 47)); + text_layer_set_text_color(bg_layer, GColorDukeBlue); + text_layer_set_background_color(bg_layer, GColorWhite); + #else + bg_layer = text_layer_create(GRect(0, -5, 95, 47)); + text_layer_set_text_color(bg_layer, GColorBlack); + text_layer_set_background_color(bg_layer, GColorWhite); + #endif + text_layer_set_font(bg_layer, fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD)); + text_layer_set_text_alignment(bg_layer, GTextAlignmentCenter); + layer_add_child(window_layer_cgm, text_layer_get_layer(bg_layer)); + + // APP TIME AGO READING - #ifdef PBL_COLOR + #ifdef PBL_ROUND + time_app_layer = text_layer_create(GRect(65, 58, 65, 24)); + text_layer_set_text_color(time_app_layer, GColorDukeBlue); + #elif PBL_COLOR time_app_layer = text_layer_create(GRect(77, 58, 40, 24)); text_layer_set_text_color(time_app_layer, GColorDukeBlue); text_layer_set_background_color(time_app_layer, GColorWhite); @@ -1929,23 +1967,14 @@ void window_load_cgm(Window *window_cgm) { text_layer_set_text_alignment(time_app_layer, GTextAlignmentRight); layer_add_child(window_layer_cgm, text_layer_get_layer(time_app_layer)); - // BG - #ifdef PBL_COLOR - bg_layer = text_layer_create(GRect(0, -5, 95, 47)); - text_layer_set_text_color(bg_layer, GColorDukeBlue); - text_layer_set_background_color(bg_layer, GColorWhite); - #else - bg_layer = text_layer_create(GRect(0, -5, 95, 47)); - text_layer_set_text_color(bg_layer, GColorBlack); - text_layer_set_background_color(bg_layer, GColorWhite); - #endif - text_layer_set_font(bg_layer, fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD)); - text_layer_set_text_alignment(bg_layer, GTextAlignmentCenter); - layer_add_child(window_layer_cgm, text_layer_get_layer(bg_layer)); + // CGM TIME AGO READING - #ifdef PBL_COLOR + #ifdef PBL_ROUND + cgmtime_layer = text_layer_create(GRect(5, 58, 60, 24)); + text_layer_set_text_color(cgmtime_layer, GColorDukeBlue); + #elif PBL_COLOR cgmtime_layer = text_layer_create(GRect(5, 58, 40, 24)); text_layer_set_text_color(cgmtime_layer, GColorDukeBlue); text_layer_set_background_color(cgmtime_layer, GColorWhite); @@ -1975,21 +2004,31 @@ void window_load_cgm(Window *window_cgm) { // WATCH BATTERY LEVEL BatteryChargeState charge_state=battery_state_service_peek(); //snprintf(watch_battlevel_percent, BATTLEVEL_FORMATTED_SIZE, "W:%i%%", charge_state.charge_percent); - #ifdef PBL_COLOR + #ifdef PBL_ROUND + watch_battlevel_layer = text_layer_create(GRect(0, 150, 180, 30)); + text_layer_set_text_alignment(watch_battlevel_layer, GTextAlignmentCenter); + APP_LOG(APP_LOG_LEVEL_INFO, "ROUND DETECTED"); + #elif PBL_COLOR watch_battlevel_layer = text_layer_create(GRect(65, 150, 80, 18)); APP_LOG(APP_LOG_LEVEL_INFO, "COLOR DETECTED"); #else - APP_LOG(APP_LOG_LEVEL_INFO, "BW DETECTED"); + // (sorry line placement in wrong place LOL) APP_LOG(APP_LOG_LEVEL_INFO, "BW DETECTED"); watch_battlevel_layer = text_layer_create(GRect(81, 148, 59, 18)); + text_layer_set_text_alignment(watch_battlevel_layer, GTextAlignmentRight); + APP_LOG(APP_LOG_LEVEL_INFO, "BW DETECTED"); #endif text_layer_set_font(watch_battlevel_layer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD)); - text_layer_set_text_alignment(watch_battlevel_layer, GTextAlignmentRight); + // text_layer_set_text_alignment(watch_battlevel_layer, GTextAlignmentRight); layer_add_child(window_layer_cgm, text_layer_get_layer(watch_battlevel_layer)); battery_handler(charge_state); //APP_LOG(APP_LOG_LEVEL_INFO, "watch_battlevel_layer; %s", text_layer_get_text(watch_battlevel_layer)); // CURRENT ACTUAL TIME FROM WATCH - #ifdef PBL_COLOR + #ifdef PBL_ROUND + time_watch_layer = text_layer_create(GRect(0, 82, 180, 56)); + text_layer_set_text_color(time_watch_layer, GColorWhite); + text_layer_set_background_color(time_watch_layer, GColorDukeBlue); + #elif PBL_COLOR time_watch_layer = text_layer_create(GRect(0, 82, 144, 44)); text_layer_set_text_color(time_watch_layer, GColorWhite); text_layer_set_background_color(time_watch_layer, GColorDukeBlue); @@ -2003,7 +2042,11 @@ void window_load_cgm(Window *window_cgm) { layer_add_child(window_layer_cgm, text_layer_get_layer(time_watch_layer)); // CURRENT ACTUAL DATE FROM APP - #ifdef PBL_COLOR + #ifdef PBL_ROUND + date_app_layer = text_layer_create(GRect(0, 124, 180, 26)); + text_layer_set_text_color(date_app_layer, GColorWhite); + text_layer_set_background_color(date_app_layer, GColorDukeBlue); + #elif PBL_COLOR date_app_layer = text_layer_create(GRect(0, 124, 144, 26)); text_layer_set_text_color(date_app_layer, GColorWhite); text_layer_set_background_color(date_app_layer, GColorDukeBlue);