void handle_init(AppContextRef ctx) { (void)ctx; window_init(&window, "VeryPlain"); window_stack_push(&window, true); window_set_background_color(&window, GColorBlack); resource_init_current_app(&APP_RESOURCES); initLayerPathAndCenter(&hour_display_layer, &hour_hand_path, &HOUR_HAND_PATH_POINTS, &hour_display_layer_update_callback); initLayerPathAndCenter(&minute_display_layer, &minute_hand_path, &MINUTE_HAND_PATH_POINTS, &minute_display_layer_update_callback); //initLayerPathAndCenter(&second_display_layer, &second_hand_path, &SECOND_HAND_PATH_POINTS, &second_display_layer_update_callback); }
void handle_init(AppContextRef ctx) { (void)ctx; window_init(&window, "VerySimple"); window_stack_push(&window, true /* Animated */); window_set_background_color(&window, GColorBlack); resource_init_current_app(&APP_RESOURCES); text_layer_init(&text_date_layer, window.layer.frame); text_layer_set_text_color(&text_date_layer, GColorWhite); text_layer_set_background_color(&text_date_layer, GColorClear); layer_set_frame(&text_date_layer.layer, GRect(8, 68, 144-8, 168-68)); text_layer_set_font(&text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROB_CONDENSED_21))); layer_add_child(&window.layer, &text_date_layer.layer); text_layer_init(&text_time_layer, window.layer.frame); text_layer_set_text_color(&text_time_layer, GColorWhite); text_layer_set_background_color(&text_time_layer, GColorClear); layer_set_frame(&text_time_layer.layer, GRect(7, 92, 144-7, 168-92)); text_layer_set_font(&text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49))); layer_add_child(&window.layer, &text_time_layer.layer); layer_init(&line_layer, window.layer.frame); line_layer.update_proc = &line_layer_update_callback; layer_add_child(&window.layer, &line_layer); initLayerPathAndCenter(&hour_display_layer, &hour_hand_path, &HOUR_HAND_POINTS, &hour_display_layer_update_callback); initLayerPathAndCenter(&minute_display_layer, &minute_hand_path, &MINUTE_HAND_POINTS, &minute_display_layer_update_callback); dow_layer.update_proc = &dow_update_proc; layer_add_child(&window.layer, &dow_layer); hour_display_layer.frame.origin.x = (144/2) - (hour_display_layer.frame.size.w/2) ; minute_display_layer.frame.origin.x = (144/2) - (minute_display_layer.frame.size.w/2) ; layer_init(¢er_display_layer, GRect(0, 0, 144, 70)); // center_display_layer.frame.origin.x = (144/2) - (center_display_layer.frame.size.w/2) ; center_display_layer.update_proc = ¢er_display_layer_update_callback; layer_add_child(&window.layer, ¢er_display_layer); }