Example #1
0
static void initialise_ui(void) {
  s_window = window_create();
  window_set_fullscreen(s_window, true);
  window_set_background_color(s_window, COLOUR_WINDOW);
  
  // s_menu
  s_menu = menu_layer_create(layer_get_bounds(window_get_root_layer(s_window)));
  if(watch_info_get_firmware_version().major >= 3) {
    scroll_layer_set_shadow_hidden(menu_layer_get_scroll_layer(s_menu), true);
  }
#ifdef PBL_SDK_3
  menu_layer_set_highlight_colors(s_menu, COLOUR_MENU_HIGHLIGHT_BACKGROUND, COLOUR_MENU_HIGHLIGHT_FOREGROUND);
  menu_layer_set_normal_colors(s_menu, COLOUR_MENU_BACKGROUND, COLOUR_MENU_FOREGROUND);
#endif
  menu_layer_set_click_config_onto_window(s_menu, s_window);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_menu);
}
static void initialise_ui(void) {
  s_window = window_create();
  window_set_fullscreen(s_window, PBL_IF_ROUND_ELSE(true, false));
  window_set_background_color(s_window, COLOUR_WINDOW);
  
  // s_menu
  s_menu = menu_layer_create(layer_get_bounds(window_get_root_layer(s_window)));
  if(watch_info_get_firmware_version().major >= 3) {
    scroll_layer_set_shadow_hidden(menu_layer_get_scroll_layer(s_menu), true);
  }
  menu_set_colours(s_menu);
#ifdef PBL_ROUND
  menu_layer_set_center_focused(s_menu, true);
#endif
  menu_layer_set_click_config_onto_window(s_menu, s_window);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_menu);
}
static void initialise_ui(void) {
  s_window = window_create();
  window_set_fullscreen(s_window, false);
  window_set_background_color(s_window, COLOUR_WINDOW);
  
  s_res_gothic_24_bold = fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD);
  s_res_gothic_24 = fonts_get_system_font(FONT_KEY_GOTHIC_24);
  // s_statusbar
  s_statusbar = text_layer_create(GRect(0, 0, 144, 21));
  text_layer_set_background_color(s_statusbar, COLOUR_HEADER);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_statusbar);
  
  // s_train_number
  s_train_number = text_layer_create(GRect(2, -7, 56, 29));
  text_layer_set_background_color(s_train_number, GColorClear);
  text_layer_set_text_color(s_train_number, COLOUR_HEADER_TEXT);
  text_layer_set_text(s_train_number, "#307");
  text_layer_set_font(s_train_number, s_res_gothic_24_bold);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_train_number);
  
  // s_train_type
  s_train_type = text_layer_create(GRect(62, -7, 80, 28));
  text_layer_set_background_color(s_train_type, GColorClear);
  text_layer_set_text_color(s_train_type, COLOUR_HEADER_TEXT);
  text_layer_set_text(s_train_type, "Something");
  text_layer_set_text_alignment(s_train_type, GTextAlignmentRight);
  text_layer_set_font(s_train_type, s_res_gothic_24);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_train_type);
  
  // s_stop_list
  s_stop_list = menu_layer_create(GRect(0, 21, 144, 131));
  #ifdef PBL_COLOR
  menu_hack_disable_inversion(s_stop_list);
  #endif
  if(watch_info_get_firmware_version().major >= 3) {
    scroll_layer_set_shadow_hidden(menu_layer_get_scroll_layer(s_stop_list), true);
  }
  menu_layer_set_click_config_onto_window(s_stop_list, s_window);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_stop_list);
}
static void initialise_ui(void) {
  s_window = window_create();
  window_set_fullscreen(s_window, false);
  window_set_background_color(s_window, COLOUR_WINDOW);
  
  s_res_gothic_24_bold = fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD);
  s_res_gothic_18 = fonts_get_system_font(FONT_KEY_GOTHIC_18);
  // s_inverterlayer_1
  s_inverterlayer_1 = inverter_layer_create(GRect(0, 0, 144, 35));
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_inverterlayer_1);
  
  // s_direction_layer
  s_direction_layer = text_layer_create(GRect(0, 14, 144, 21));
  text_layer_set_background_color(s_direction_layer, COLOUR_HEADER);
  text_layer_set_text_color(s_direction_layer, COLOUR_HEADER_TEXT);
  text_layer_set_text(s_direction_layer, "Southbound");
  text_layer_set_text_alignment(s_direction_layer, GTextAlignmentCenter);
  text_layer_set_font(s_direction_layer, s_res_gothic_18);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_direction_layer);
  
  // s_stop_name_layer
  s_stop_name_layer = text_layer_create(GRect(0, -8, 144, 28));
  text_layer_set_background_color(s_stop_name_layer, COLOUR_HEADER);
  text_layer_set_text_color(s_stop_name_layer, COLOUR_HEADER_TEXT);
  text_layer_set_text(s_stop_name_layer, "Mountain View");
  text_layer_set_text_alignment(s_stop_name_layer, GTextAlignmentCenter);
  text_layer_set_font(s_stop_name_layer, s_res_gothic_24_bold);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_stop_name_layer);
  
  // s_train_menu
  s_train_menu = menu_layer_create(GRect(0, 35, 144, 117));
  #ifdef PBL_COLOR
  menu_hack_disable_inversion(s_train_menu);
  #endif
  if(watch_info_get_firmware_version().major >= 3) {
    scroll_layer_set_shadow_hidden(menu_layer_get_scroll_layer(s_train_menu), true);
  }
  menu_layer_set_click_config_onto_window(s_train_menu, s_window);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_train_menu);
}
char* WATCH__getFirmwareVersion() {

    WatchInfoVersion v = watch_info_get_firmware_version();
    return memoryM()->Format("%d.%d.%d", v.major, v.minor, v.patch);
}