diff --git a/src/c/main.c b/src/c/main.c index b366ff6..51239ab 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -332,6 +332,13 @@ static void main_window_unload(Window *window) { animation_destroy(s_head_out_template); } +static void bluetooth_callback(bool connected) { + replace_gbitmap_color(GColorLightGray, GColorBlack, s_bt_icon, s_bt_layer); + if (!connected) { + replace_gbitmap_color(GColorBlack, GColorLightGray, s_bt_icon, s_bt_layer); + } +} + // DEBUG buttons static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) { Window *window = (Window *)context; @@ -442,6 +449,9 @@ static void init() { // show the Window on the watch, with animated=true window_stack_push(s_main_window, true); + // register with ConnectionService (bluetooth status) + connection_service_subscribe((ConnectionHandlers){.pebble_app_connection_handler=bluetooth_callback}); + // register with TickTimerService tick_timer_service_subscribe(MINUTE_UNIT, minute_handler);