From a2c24a988f4f53473567263c737b72f8a0ed8198 Mon Sep 17 00:00:00 2001 From: chihtinglo Date: Mon, 9 Jan 2023 10:26:54 +0800 Subject: [PATCH] Trigger re-inflation when configuration changed We re-inflate the layout when font or display size are scaled and do follow fixes: 1. Listen to CONFIG_FONT_SCALE and CONFIG_DENSITY for layout re-inflaction. 2. Remove the configurations of image button and Done button paddings, and set the size of icons and center the text directly so the contents instead of the paddings inside the button will scale up when we increase the display size. 3. Reconstruct the layout to guarantee all components will stay in the settings panel without being cut. Bug: 257272333 Test: manual - attach videos with the bug Change-Id: Id3f120dbdd1afb3863a85f105059beee1ec460da Merged-In: Id3f120dbdd1afb3863a85f105059beee1ec460da --- .../drawable/ic_magnification_menu_large.xml | 4 +- .../drawable/ic_magnification_menu_medium.xml | 4 +- .../drawable/ic_magnification_menu_small.xml | 4 +- .../SystemUI/res/drawable/ic_open_in_full.xml | 4 +- .../window_magnification_settings_view.xml | 45 +++++-------------- packages/SystemUI/res/values/styles.xml | 1 + .../WindowMagnificationController.java | 12 +++-- .../WindowMagnificationSettings.java | 24 +++++----- 8 files changed, 39 insertions(+), 59 deletions(-) diff --git a/packages/SystemUI/res/drawable/ic_magnification_menu_large.xml b/packages/SystemUI/res/drawable/ic_magnification_menu_large.xml index 92c952794f578..401ac73f3e0a3 100644 --- a/packages/SystemUI/res/drawable/ic_magnification_menu_large.xml +++ b/packages/SystemUI/res/drawable/ic_magnification_menu_large.xml @@ -14,8 +14,8 @@ limitations under the License. --> diff --git a/packages/SystemUI/res/drawable/ic_magnification_menu_medium.xml b/packages/SystemUI/res/drawable/ic_magnification_menu_medium.xml index 209681f295488..9a850e8fb8113 100644 --- a/packages/SystemUI/res/drawable/ic_magnification_menu_medium.xml +++ b/packages/SystemUI/res/drawable/ic_magnification_menu_medium.xml @@ -14,8 +14,8 @@ limitations under the License. --> diff --git a/packages/SystemUI/res/drawable/ic_magnification_menu_small.xml b/packages/SystemUI/res/drawable/ic_magnification_menu_small.xml index a3dc816f67558..54322c562c5d7 100644 --- a/packages/SystemUI/res/drawable/ic_magnification_menu_small.xml +++ b/packages/SystemUI/res/drawable/ic_magnification_menu_small.xml @@ -14,8 +14,8 @@ limitations under the License. --> diff --git a/packages/SystemUI/res/drawable/ic_open_in_full.xml b/packages/SystemUI/res/drawable/ic_open_in_full.xml index c7f3236f94cf7..7081c4b91bca5 100644 --- a/packages/SystemUI/res/drawable/ic_open_in_full.xml +++ b/packages/SystemUI/res/drawable/ic_open_in_full.xml @@ -14,8 +14,8 @@ ~ limitations under the License. --> diff --git a/packages/SystemUI/res/layout/window_magnification_settings_view.xml b/packages/SystemUI/res/layout/window_magnification_settings_view.xml index ae0f8f46599d9..3d0741c80450c 100644 --- a/packages/SystemUI/res/layout/window_magnification_settings_view.xml +++ b/packages/SystemUI/res/layout/window_magnification_settings_view.xml @@ -35,7 +35,7 @@ android:text="@string/accessibility_magnifier_size" android:textAppearance="@style/TextAppearance.MagnificationSetting.Title" android:focusable="true" - android:layout_gravity="center_vertical|left" /> + android:layout_gravity="center_vertical" />