From 28cc351e46f2bbb067e2733cffa706152b4e13f8 Mon Sep 17 00:00:00 2001 From: chihtinglo Date: Mon, 12 Dec 2022 16:51:36 +0800 Subject: Re-inflating view in onConfigurationChange We change the behavior of adapting to theme changes to re-inflate the view and hook the method "onConfigurationChange" for the setting panel to the controller. All resources are configurated in resource files. To achieve theme change for setting panel: 1. We hide/remove the panel from screen if it is visible. 2. We inflate the view again. The contents in "inflateView" are extracted from the origin constructor. 3. We show the panel if it is opened before the theme changes. We only move resource configurations to resource files and the contents of resources remain the same. Bug: 257272333 Test: manual - attach screenshots with the bug Change-Id: I6fe7b800a9fabc25a192749896480446347f99d7 --- .../layout/window_magnification_settings_view.xml | 30 +++- .../WindowMagnificationController.java | 1 + .../accessibility/WindowMagnificationSettings.java | 176 +++++++++------------ 3 files changed, 102 insertions(+), 105 deletions(-) diff --git a/packages/SystemUI/res/layout/window_magnification_settings_view.xml b/packages/SystemUI/res/layout/window_magnification_settings_view.xml index 6d8847cce644..a3c055419541 100644 --- a/packages/SystemUI/res/layout/window_magnification_settings_view.xml +++ b/packages/SystemUI/res/layout/window_magnification_settings_view.xml @@ -37,6 +37,7 @@