From 171b4c4cbe6ba5af3fd7df87d227eda44e308727 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 19 Jun 2017 23:10:44 -0700 Subject: 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) --- screen_ui.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index bd99254f6..fd9f471e9 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -72,10 +72,11 @@ class ScreenRecoveryUI : public RecoveryUI { void SetColor(UIElement e); protected: + // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. + const float density_; + Icon currentIcon; - // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. - float density_; // The layout to use. int layout_; @@ -136,6 +137,12 @@ class ScreenRecoveryUI : public RecoveryUI { int char_width_; int char_height_; + + // The margin that we don't want to use for showing texts (e.g. round screen, or screen with + // rounded corners). + int margin_width_; + int margin_height_; + pthread_mutex_t updateMutex; virtual bool InitTextParams(); -- cgit v1.2.3