summaryrefslogtreecommitdiffstats
path: root/wear_ui.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-23 10:14:50 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-23 10:14:50 +0200
commite4c7329b8763999ac44518db23cdb834f4e1a859 (patch)
tree20792a8d8c8d8f4dfa0bb9439c246bda68c7afea /wear_ui.cpp
parentrelease-request-38d4765e-6779-4912-a79f-25f77b8184a7-for-git_pi-release-4288638 snap-temp-L71800000095143664 (diff)
parentMerge "Allow comparison against multi serial nums for A/B package" am: 3810046a55 am: e8b02d68e5 am: 968ebdeefd am: 7379a5290d (diff)
downloadandroid_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar.gz
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar.bz2
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar.lz
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar.xz
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.tar.zst
android_bootable_recovery-e4c7329b8763999ac44518db23cdb834f4e1a859.zip
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 18c30d34a..169ef20e1 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -51,10 +51,16 @@ static double now() {
}
WearRecoveryUI::WearRecoveryUI()
- : progress_bar_y(259), outer_height(0), outer_width(0), menu_unusable_rows(0) {
+ : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE),
+ kMenuUnusableRows(RECOVERY_UI_MENU_UNUSABLE_ROWS) {
+ // TODO: kMenuUnusableRows should be computed based on the lines in draw_screen_locked().
+
+ // TODO: The following three variables are likely not needed. The first two are detected
+ // automatically in ScreenRecoveryUI::LoadAnimation(), based on the actual files seen on device.
intro_frames = 22;
loop_frames = 60;
- animation_fps = 30;
+
+ touch_screen_allowed_ = true;
for (size_t i = 0; i < 5; i++) backgroundIcon[i] = NULL;
@@ -62,7 +68,7 @@ WearRecoveryUI::WearRecoveryUI()
}
int WearRecoveryUI::GetProgressBaseline() const {
- return progress_bar_y;
+ return kProgressBarBaseline;
}
// Draw background frame on the screen. Does not flip pages.
@@ -113,8 +119,8 @@ void WearRecoveryUI::draw_screen_locked() {
SetColor(TEXT_FILL);
gr_fill(0, 0, gr_fb_width(), gr_fb_height());
- int y = outer_height;
- int x = outer_width;
+ int y = kMarginHeight;
+ int x = kMarginWidth;
if (show_menu) {
std::string recovery_fingerprint =
android::base::GetProperty("ro.bootimage.build.fingerprint", "");
@@ -170,7 +176,7 @@ void WearRecoveryUI::draw_screen_locked() {
int ty;
int row = (text_top_ + text_rows_ - 1) % text_rows_;
size_t count = 0;
- for (int ty = gr_fb_height() - char_height_ - outer_height; ty > y + 2 && count < text_rows_;
+ for (int ty = gr_fb_height() - char_height_ - kMarginHeight; ty > y + 2 && count < text_rows_;
ty -= char_height_, ++count) {
gr_text(gr_sys_font(), x + 4, ty, text_[row], 0);
--row;
@@ -190,12 +196,12 @@ bool WearRecoveryUI::InitTextParams() {
return false;
}
- text_cols_ = (gr_fb_width() - (outer_width * 2)) / char_width_;
+ text_cols_ = (gr_fb_width() - (kMarginWidth * 2)) / char_width_;
if (text_rows_ > kMaxRows) text_rows_ = kMaxRows;
if (text_cols_ > kMaxCols) text_cols_ = kMaxCols;
- visible_text_rows = (gr_fb_height() - (outer_height * 2)) / char_height_;
+ visible_text_rows = (gr_fb_height() - (kMarginHeight * 2)) / char_height_;
return true;
}
@@ -263,7 +269,7 @@ void WearRecoveryUI::StartMenu(const char* const* headers, const char* const* it
show_menu = true;
menu_sel = initial_selection;
menu_start = 0;
- menu_end = visible_text_rows - 1 - menu_unusable_rows;
+ menu_end = visible_text_rows - 1 - kMenuUnusableRows;
if (menu_items <= menu_end) menu_end = menu_items;
update_screen_locked();
}