static void window_load(Window *window) { //Font ResHandle font_handle = resource_get_handle(RESOURCE_ID_FONT_LUCIDA_16); //Time time_label = cl_init_text_layer(GRect(5, 5, 144, 30), GColorWhite, GColorClear, font_handle, GTextAlignmentLeft); text_layer_set_text(time_label, ""); layer_add_child(window_get_root_layer(window), text_layer_get_layer(time_label)); time_layer = cl_init_text_layer(GRect(5, 24, 144, 30), GColorWhite, GColorClear, font_handle, GTextAlignmentLeft); text_layer_set_text(time_layer, ""); layer_add_child(window_get_root_layer(window), text_layer_get_layer(time_layer)); //Date date_label = cl_init_text_layer(GRect(5, 53, 144, 30), GColorWhite, GColorClear, font_handle, GTextAlignmentLeft); text_layer_set_text(date_label, ""); layer_add_child(window_get_root_layer(window), text_layer_get_layer(date_label)); date_layer = cl_init_text_layer(GRect(5, 70, 144, 30), GColorWhite, GColorClear, font_handle, GTextAlignmentLeft); text_layer_set_text(date_layer, ""); layer_add_child(window_get_root_layer(window), text_layer_get_layer(date_layer)); //Prompt prompt_label = cl_init_text_layer(GRect(5, 99, 144, 30), GColorWhite, GColorClear, font_handle, GTextAlignmentLeft); text_layer_set_text(prompt_label, ""); layer_add_child(window_get_root_layer(window), text_layer_get_layer(prompt_label)); prompt_layer = inverter_layer_create(GRect(45, 115, 12, 2)); }
static void window_load(Window *window) { //Get resources ResHandle font_20 = resource_get_handle(RESOURCE_ID_FONT_IMAGINE_20); ResHandle font_25 = resource_get_handle(RESOURCE_ID_FONT_IMAGINE_25); ResHandle font_43 = resource_get_handle(RESOURCE_ID_FONT_IMAGINE_43); //Bottom frame lower_layer = text_layer_create(GRect(0, 84, 144, 84)); text_layer_set_background_color(lower_layer, GColorBlack); layer_add_child(window_get_root_layer(window), text_layer_get_layer(lower_layer)); //TextLayers time_layer = cl_init_text_layer(GRect(1, 41, 150, 50), GColorBlack, GColorClear, font_43, GTextAlignmentLeft); layer_add_child(window_get_root_layer(window), text_layer_get_layer(time_layer)); am_pm_layer = cl_init_text_layer(GRect(0, 0, 0, 0), GColorBlack, GColorClear, font_20, GTextAlignmentLeft); layer_add_child(window_get_root_layer(window), text_layer_get_layer(am_pm_layer)); day_layer = cl_init_text_layer(GRect(1, 75, 150, 50), GColorWhite, GColorClear, font_25, GTextAlignmentLeft); text_layer_set_text(day_layer, "MON"); layer_add_child(window_get_root_layer(window), text_layer_get_layer(day_layer)); date_layer = cl_init_text_layer(GRect(70, 75, 150, 50), GColorWhite, GColorClear, font_25, GTextAlignmentLeft); text_layer_set_text(date_layer, "25"); layer_add_child(window_get_root_layer(window), text_layer_get_layer(date_layer)); month_layer = cl_init_text_layer(GRect(1, 95, 150, 50), GColorWhite, GColorClear, font_20, GTextAlignmentLeft); text_layer_set_text(month_layer, "JANUARY"); layer_add_child(window_get_root_layer(window), text_layer_get_layer(month_layer)); //Init display not blank time_t temp = time(NULL); struct tm *t = localtime(&temp); set_time(t); }
static void window_load(Window *window) { x_layer = cl_init_text_layer(GRect(0, 0, 144, 24), GColorBlack, GColorClear, false, 0, FONT_KEY_GOTHIC_18, GTextAlignmentLeft); text_layer_set_text(x_layer, "Waiting for Android..."); layer_add_child(window_get_root_layer(window), text_layer_get_layer(x_layer)); y_layer = cl_init_text_layer(GRect(0, 24, 144, 24), GColorBlack, GColorClear, false, 0, FONT_KEY_GOTHIC_18, GTextAlignmentLeft); layer_add_child(window_get_root_layer(window), text_layer_get_layer(y_layer)); z_layer = cl_init_text_layer(GRect(0, 48, 144, 24), GColorBlack, GColorClear, false, 0, FONT_KEY_GOTHIC_18, GTextAlignmentLeft); layer_add_child(window_get_root_layer(window), text_layer_get_layer(z_layer)); }
static void window_load(Window *window) { window_set_background_color(window, GColorBlack); //Power bitmap power_bitmap = gbitmap_create_with_resource(RESOURCE_ID_POWER); //Phase phase_layer = layer_create(GRECT_PHASE_SHOWING); layer_set_update_proc(phase_layer, (LayerUpdateProc)phase_update_proc); layer_add_child(window_get_root_layer(window), phase_layer); //Time display under background time_bg_layer = layer_create(GRECT_TIME_BG_HIDDEN); time_layer = cl_init_text_layer(GRECT_TIME_BG_HIDDEN, GColorBlack, GColorClear, false, 0, FONT_KEY_GOTHIC_24_BOLD, GTextAlignmentCenter); layer_set_update_proc(time_bg_layer, (LayerUpdateProc)bg_update_proc); layer_add_child(window_get_root_layer(window), time_bg_layer); layer_add_child(window_get_root_layer(window), text_layer_get_layer(time_layer)); //Bluetooth bt_on_bitmap = gbitmap_create_with_resource(RESOURCE_ID_BT_ON); bt_off_bitmap = gbitmap_create_with_resource(RESOURCE_ID_BT_OFF); bt_layer = bitmap_layer_create(GRECT_BT_HIDDEN); layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(bt_layer)); //Battery battery_layer = layer_create(GRECT_BATTERY_HIDDEN); layer_set_update_proc(battery_layer, (LayerUpdateProc)battery_update_proc); layer_add_child(window_get_root_layer(window), battery_layer); //Background background_white_bitmap = gbitmap_create_with_resource(RESOURCE_ID_BACKGROUND_WHITE); background_white_layer = bitmap_layer_create(GRect(0, 0, 144, 168)); bitmap_layer_set_compositing_mode(background_white_layer, GCompOpOr); bitmap_layer_set_bitmap(background_white_layer, background_white_bitmap); layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(background_white_layer)); background_black_bitmap = gbitmap_create_with_resource(RESOURCE_ID_BACKGROUND_BLACK); background_black_layer = bitmap_layer_create(GRect(0, 0, 144, 168)); bitmap_layer_set_compositing_mode(background_black_layer, GCompOpAnd); bitmap_layer_set_bitmap(background_black_layer, background_black_bitmap); layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(background_black_layer)); //Date date_bg_layer = layer_create(GRECT_DATE_BG_HIDDEN); date_layer = cl_init_text_layer(GRECT_DATE_BG_HIDDEN, GColorBlack, GColorClear, false, 0, FONT_KEY_GOTHIC_24_BOLD, GTextAlignmentCenter); layer_set_update_proc(date_bg_layer, (LayerUpdateProc)bg_update_proc); layer_add_child(window_get_root_layer(window), date_bg_layer); layer_add_child(window_get_root_layer(window), text_layer_get_layer(date_layer)); //Animate in cl_animate_layer(phase_layer, GRECT_PHASE_HIDDEN, GRECT_PHASE_SHOWING, 1000, 200); }