aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-06-20 01:10:44 -0500
committerTao Bao2017-06-20 17:47:06 -0500
commit171b4c4cbe6ba5af3fd7df87d227eda44e308727 (patch)
treea1b9543cf947e02fc0f61fe24465fed7d41f2147 /screen_ui.h
parent5efe2bca2282dd8aa613ae85b267780f6c1d1307 (diff)
downloadplatform-bootable-recovery-171b4c4cbe6ba5af3fd7df87d227eda44e308727.tar.gz
platform-bootable-recovery-171b4c4cbe6ba5af3fd7df87d227eda44e308727.tar.xz
platform-bootable-recovery-171b4c4cbe6ba5af3fd7df87d227eda44e308727.zip
screen_ui: Allow setting screen margin space.
We already have outer_width and outer_height in wear UI, and x_offset and y_offset in VR UI. This CL adds margin_width_ and margin_height_ to their base class (ScreenRecoveryUI) to shorten the gap. This will be in general useful for round or round-cornered screens. Move the density computation to ScreenRecoveryUI ctor so that the value can be used earlier. Bug: 62732748 Test: Setting and not setting margin_{width,height}_ on angler. Check the recovery texts (recovery menu as well as 'View recovery logs'). Change-Id: Ibf6238c9cc8949a42ed8a410e1c09d55b0b5a151 (cherry picked from commit 87f4650874346f1d0238e70b148a31cea5e19a2e)
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/screen_ui.h b/screen_ui.h
index bd99254f..fd9f471e 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -72,10 +72,11 @@ class ScreenRecoveryUI : public RecoveryUI {
72 void SetColor(UIElement e); 72 void SetColor(UIElement e);
73 73
74 protected: 74 protected:
75 // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi.
76 const float density_;
77
75 Icon currentIcon; 78 Icon currentIcon;
76 79
77 // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi.
78 float density_;
79 // The layout to use. 80 // The layout to use.
80 int layout_; 81 int layout_;
81 82
@@ -136,6 +137,12 @@ class ScreenRecoveryUI : public RecoveryUI {
136 137
137 int char_width_; 138 int char_width_;
138 int char_height_; 139 int char_height_;
140
141 // The margin that we don't want to use for showing texts (e.g. round screen, or screen with
142 // rounded corners).
143 int margin_width_;
144 int margin_height_;
145
139 pthread_mutex_t updateMutex; 146 pthread_mutex_t updateMutex;
140 147
141 virtual bool InitTextParams(); 148 virtual bool InitTextParams();