aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-08-11 15:50:24 -0500
committerTao Bao2017-08-11 15:53:58 -0500
commiteea3af3f911d36ac1a82a9fb95d24912cc07e3b1 (patch)
treeab72b478fbfe1b123f48cf06fb1c2096c02412d8 /wear_ui.cpp
parent0470ceea381775b09eee931858c3320be88cc637 (diff)
downloadplatform-bootable-recovery-eea3af3f911d36ac1a82a9fb95d24912cc07e3b1.tar.gz
platform-bootable-recovery-eea3af3f911d36ac1a82a9fb95d24912cc07e3b1.tar.xz
platform-bootable-recovery-eea3af3f911d36ac1a82a9fb95d24912cc07e3b1.zip
wear_ui: Expose menu_unusable_rows via Makefile var.
This variable is useful on small screens (e.g. on watches) to handle long menus. We should have better way to handle this value smartly. Prior to that, expose the value to be overridable by using the generic wearable UI module (librecovery_ui_wear). Bug: 64307776 Test: Define the variable, build and boot into recovery image and check the UI menu. Change-Id: I5d7a6baa8bb4cc852bfcc2a7b3cc9686c1c8817e
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index b8801a0b..169ef20e 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -51,8 +51,9 @@ static double now() {
51} 51}
52 52
53WearRecoveryUI::WearRecoveryUI() 53WearRecoveryUI::WearRecoveryUI()
54 : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE), menu_unusable_rows(9) { 54 : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE),
55 // TODO: menu_unusable_rows should be computed based on the lines in draw_screen_locked(). 55 kMenuUnusableRows(RECOVERY_UI_MENU_UNUSABLE_ROWS) {
56 // TODO: kMenuUnusableRows should be computed based on the lines in draw_screen_locked().
56 57
57 // TODO: The following three variables are likely not needed. The first two are detected 58 // TODO: The following three variables are likely not needed. The first two are detected
58 // automatically in ScreenRecoveryUI::LoadAnimation(), based on the actual files seen on device. 59 // automatically in ScreenRecoveryUI::LoadAnimation(), based on the actual files seen on device.
@@ -268,7 +269,7 @@ void WearRecoveryUI::StartMenu(const char* const* headers, const char* const* it
268 show_menu = true; 269 show_menu = true;
269 menu_sel = initial_selection; 270 menu_sel = initial_selection;
270 menu_start = 0; 271 menu_start = 0;
271 menu_end = visible_text_rows - 1 - menu_unusable_rows; 272 menu_end = visible_text_rows - 1 - kMenuUnusableRows;
272 if (menu_items <= menu_end) menu_end = menu_items; 273 if (menu_items <= menu_end) menu_end = menu_items;
273 update_screen_locked(); 274 update_screen_locked();
274 } 275 }