@@ -68,6 +68,8 @@ static Window* s_window;
6868static Layer * s_layer_count ;
6969static Layer * s_layer_name ;
7070static Layer * s_layer_dots ;
71+ static Layer * s_indicator_up_layer ;
72+ static Layer * s_indicator_down_layer ;
7173static AppInfo * s_app_info ;
7274static uint8_t s_app_position = 0 ;
7375static uint8_t s_app_position_new = 0 ;
@@ -83,7 +85,8 @@ static uint16_t s_name_offset = 0;
8385static uint8_t s_animation_direction ;
8486static uint16_t s_dot_current_x = 0 ;
8587static GSize s_window_size ;
86-
88+ static ContentIndicator * s_indicator_up ;
89+ static ContentIndicator * s_indicator_down ;
8790
8891void win_main_init (void ) {
8992 s_window = window_create ();
@@ -136,9 +139,45 @@ static void window_load(Window* window) {
136139 layer_set_update_proc (s_layer_count , layer_update_count );
137140 layer_add_to_window (s_layer_count , window );
138141
139- s_layer_dots = layer_create (GRect (0 , 140 , s_window_size .w , 12 ));
142+ s_layer_dots = layer_create (GRect (0 , 120 , s_window_size .w , 12 ));
140143 layer_set_update_proc (s_layer_dots , layer_update_dots );
141144 layer_add_to_window (s_layer_dots , window );
145+
146+ s_indicator_up_layer = layer_create (GRect (0 , 0 ,
147+ s_window_size .w , STATUS_BAR_LAYER_HEIGHT ));
148+ s_indicator_down_layer = layer_create (GRect (0 , s_window_size .h - STATUS_BAR_LAYER_HEIGHT ,
149+ s_window_size .w , STATUS_BAR_LAYER_HEIGHT ));
150+ layer_add_child (window_get_root_layer (window ), s_indicator_up_layer );
151+ layer_add_child (window_get_root_layer (window ), s_indicator_down_layer );
152+
153+ s_indicator_up = content_indicator_create ();
154+ const ContentIndicatorConfig up_config = (ContentIndicatorConfig ) {
155+ .layer = s_indicator_up_layer ,
156+ .times_out = true,
157+ .alignment = GAlignCenter ,
158+ .colors = {
159+ .foreground = GColorWhite ,
160+ .background = COLOR_FALLBACK (GColorDarkCandyAppleRed , GColorBlack )
161+ }
162+ };
163+ content_indicator_configure_direction (s_indicator_up , ContentIndicatorDirectionUp ,
164+ & up_config );
165+
166+ s_indicator_down = content_indicator_create ();
167+ const ContentIndicatorConfig down_config = (ContentIndicatorConfig ) {
168+ .layer = s_indicator_down_layer ,
169+ .times_out = true,
170+ .alignment = GAlignCenter ,
171+ .colors = {
172+ .foreground = GColorWhite ,
173+ .background = COLOR_FALLBACK (GColorDarkCandyAppleRed , GColorBlack )
174+ }
175+ };
176+ content_indicator_configure_direction (s_indicator_down , ContentIndicatorDirectionDown ,
177+ & down_config );
178+
179+ content_indicator_set_content_available (s_indicator_down , ContentIndicatorDirectionDown , true);
180+ content_indicator_set_content_available (s_indicator_up , ContentIndicatorDirectionUp , false);
142181}
143182
144183static void window_unload (Window * window ) {
@@ -161,6 +200,9 @@ static void do_transition(void) {
161200
162201 transition_animation_implementation .update = transition_animation_update ;
163202 transition_animation_run (ANIMATION_DURATION , 0 , & transition_animation_implementation , true);
203+
204+ content_indicator_set_content_available (s_indicator_down , ContentIndicatorDirectionDown , s_app_position < (app_info_count - 1 ));
205+ content_indicator_set_content_available (s_indicator_up , ContentIndicatorDirectionUp , s_app_position > 0 );
164206}
165207
166208static void up_click_handler (ClickRecognizerRef recognizer , void * context ) {
0 commit comments