summaryrefslogtreecommitdiff
path: root/libs/WindowManager
diff options
context:
space:
mode:
authorMariia Sandrikova <mariiasand@google.com>2021-12-23 17:45:44 +0000
committerMariia Sandrikova <mariiasand@google.com>2021-12-23 18:37:59 +0000
commitd8cbcc46be0ccce546073d4acfd08fbdb36c8df3 (patch)
treeb2b3203334113a2c16ec05d28e6bdd0a40520679 /libs/WindowManager
parent80b9d0eb42e95c23ae0a52ed3a087a591564cab6 (diff)
[5/n] Camera Compat UI: Unify margins logic for camera and size compat controls.
Before this change, margin between a hint and a camera compat control was smaller than required 8 dp while for a size compat control it was bigger than 8dp (since ag/16420818). This change makes them consistent and also simplifies layout definition for the size compat button by declaring margings explicitly rather than including them in width and height implicitly. Test: manual Bug: 206602997 Change-Id: I09839e764d2c8904954a594433888bfdc21d56ba
Diffstat (limited to 'libs/WindowManager')
-rw-r--r--libs/WindowManager/Shell/res/layout/compat_mode_hint.xml2
-rw-r--r--libs/WindowManager/Shell/res/layout/compat_ui_layout.xml10
-rw-r--r--libs/WindowManager/Shell/res/values/dimen.xml11
3 files changed, 11 insertions, 12 deletions
diff --git a/libs/WindowManager/Shell/res/layout/compat_mode_hint.xml b/libs/WindowManager/Shell/res/layout/compat_mode_hint.xml
index 4ac972c6cfa7..44b2f45052ba 100644
--- a/libs/WindowManager/Shell/res/layout/compat_mode_hint.xml
+++ b/libs/WindowManager/Shell/res/layout/compat_mode_hint.xml
@@ -21,7 +21,7 @@
android:orientation="vertical"
android:clipToPadding="false"
android:paddingEnd="@dimen/compat_hint_padding_end"
- android:paddingBottom="5dp"
+ android:paddingBottom="8dp"
android:clickable="true">
<TextView
diff --git a/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml b/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
index c99f3fe89563..dfaeeeb81c07 100644
--- a/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
+++ b/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
@@ -33,8 +33,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="false"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="16dp"
+ android:layout_marginEnd="@dimen/compat_button_margin"
+ android:layout_marginBottom="@dimen/compat_button_margin"
android:orientation="vertical">
<ImageButton
@@ -62,8 +62,10 @@
<ImageButton
android:id="@+id/size_compat_restart_button"
android:visibility="gone"
- android:layout_width="@dimen/size_compat_button_width"
- android:layout_height="@dimen/size_compat_button_height"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/compat_button_margin"
+ android:layout_marginBottom="@dimen/compat_button_margin"
android:src="@drawable/size_compat_restart_button_ripple"
android:background="@android:color/transparent"
android:contentDescription="@string/restart_button_description"/>
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index d338e3bd74f9..1c19a10ab231 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -200,11 +200,8 @@
<!-- Size of user education views on large screens (phone is just match parent). -->
<dimen name="bubbles_user_education_width_large_screen">400dp</dimen>
- <!-- The width of the size compat restart button including padding. -->
- <dimen name="size_compat_button_width">80dp</dimen>
-
- <!-- The height of the size compat restart button including padding. -->
- <dimen name="size_compat_button_height">64dp</dimen>
+ <!-- Bottom and end margin for compat buttons. -->
+ <dimen name="compat_button_margin">16dp</dimen>
<!-- The radius of the corners of the compat hint bubble. -->
<dimen name="compat_hint_corner_radius">28dp</dimen>
@@ -212,8 +209,8 @@
<!-- The width of the compat hint point. -->
<dimen name="compat_hint_point_width">10dp</dimen>
- <!-- The end padding for the compat hint. Computed as (size_compat_button_width / 2
- - compat_hint_corner_radius - compat_hint_point_width /2). -->
+ <!-- The end padding for the compat hint. Computed as (compat button width (=48) / 2
+ + compat_button_margin - compat_hint_corner_radius - compat_hint_point_width / 2). -->
<dimen name="compat_hint_padding_end">7dp</dimen>
<!-- The width of the size compat hint. -->