From 4d778077fcabc243b7ae3924ecf99d3eabb5cf06 Mon Sep 17 00:00:00 2001 From: chihtinglo Date: Mon, 26 Dec 2022 15:21:09 +0800 Subject: [PATCH] Style panel with Material designs (4/n) The following components are styled to follow Material designs in this modification: 1. Seekbar - Creating SeekBarWithIconButtonsView for common usage in SystemUI. The Layout includes a Start Icon and an End Icon that could modify the progress of the seekbar in the middle. The Start Icon will be disabled when the progress reaches 0, and the End Icon will be disabled when the progress reaches Max. Otherwise, they are enabled Bug: 257272333 Test: manual - attach videos with the bug Test: atest SystemUITests:com.android.systemui.common.ui.view.IconDiscreteSliderLinearLayoutTest Change-Id: If64490a6bdc599c66ae55b8f75e438b11d7c1b54 --- .../res/layout/seekbar_with_icon_buttons.xml | 60 ++++++ .../window_magnification_settings_view.xml | 14 +- packages/SystemUI/res/values/attrs.xml | 7 + packages/SystemUI/res/values/dimens.xml | 2 + .../WindowMagnificationSettings.java | 6 +- .../ui/view/SeekBarWithIconButtonsView.java | 185 ++++++++++++++++++ .../view/SeekBarWithIconButtonsViewTest.java | 97 +++++++++ 7 files changed, 363 insertions(+), 8 deletions(-) create mode 100644 packages/SystemUI/res/layout/seekbar_with_icon_buttons.xml create mode 100644 packages/SystemUI/src/com/android/systemui/common/ui/view/SeekBarWithIconButtonsView.java create mode 100644 packages/SystemUI/tests/src/com/android/systemui/common/ui/view/SeekBarWithIconButtonsViewTest.java diff --git a/packages/SystemUI/res/layout/seekbar_with_icon_buttons.xml b/packages/SystemUI/res/layout/seekbar_with_icon_buttons.xml new file mode 100644 index 0000000000000..f20b5821722f1 --- /dev/null +++ b/packages/SystemUI/res/layout/seekbar_with_icon_buttons.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout/window_magnification_settings_view.xml b/packages/SystemUI/res/layout/window_magnification_settings_view.xml index 377eb9794817d..550e9924faf22 100644 --- a/packages/SystemUI/res/layout/window_magnification_settings_view.xml +++ b/packages/SystemUI/res/layout/window_magnification_settings_view.xml @@ -15,6 +15,7 @@ limitations under the License. --> - + android:layout_height="wrap_content" + app:max="6" + app:progress="0" + app:iconStartContentDescription="@string/accessibility_control_zoom_out" + app:iconEndContentDescription="@string/accessibility_control_zoom_in"/>