From dc78c847489cbacbd09f4c5efdb95cf606a01c88 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 30 Mar 2020 08:09:18 -0400 Subject: [PATCH] Controls UI - Support detail panels Allow apps to specify whether to show full screen or within detail panels. Default camers and thermostats to use the panel by default when the following flag is enabled. Enable by: adb shell settings put secure systemui.controls_use_panel 1 Change offset from the top in Px: adb shell settings put secure systemui.controls_panel_top_offset XXX Bug: 152528130 Test: manual, use camera, thermostat devices Change-Id: Ia1b12afcf4de2a0bcf7957e6425b282b1e220f46 --- packages/SystemUI/res/anim/bottomsheet_in.xml | 26 +++++ .../SystemUI/res/anim/bottomsheet_out.xml | 25 +++++ .../SystemUI/res/drawable/rounded_bg_top.xml | 22 ++++ .../res/layout/controls_detail_dialog.xml | 73 +++++++++++- packages/SystemUI/res/values/dimens.xml | 6 + packages/SystemUI/res/values/styles.xml | 18 +++ .../controls/ui/ControlActionCoordinator.kt | 50 ++++++--- .../systemui/controls/ui/ControlViewHolder.kt | 40 +++++-- .../controls/ui/ControlsUiControllerImpl.kt | 9 +- .../systemui/controls/ui/DetailDialog.kt | 104 +++++++++++------- .../controls/ui/TemperatureControlBehavior.kt | 4 + .../systemui/controls/ui/TouchBehavior.kt | 8 +- 12 files changed, 312 insertions(+), 73 deletions(-) create mode 100644 packages/SystemUI/res/anim/bottomsheet_in.xml create mode 100644 packages/SystemUI/res/anim/bottomsheet_out.xml create mode 100644 packages/SystemUI/res/drawable/rounded_bg_top.xml diff --git a/packages/SystemUI/res/anim/bottomsheet_in.xml b/packages/SystemUI/res/anim/bottomsheet_in.xml new file mode 100644 index 0000000000000..0d5efeb2be1e0 --- /dev/null +++ b/packages/SystemUI/res/anim/bottomsheet_in.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/packages/SystemUI/res/anim/bottomsheet_out.xml b/packages/SystemUI/res/anim/bottomsheet_out.xml new file mode 100644 index 0000000000000..01f8d2d6b2a3d --- /dev/null +++ b/packages/SystemUI/res/anim/bottomsheet_out.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/packages/SystemUI/res/drawable/rounded_bg_top.xml b/packages/SystemUI/res/drawable/rounded_bg_top.xml new file mode 100644 index 0000000000000..988ab5874b07e --- /dev/null +++ b/packages/SystemUI/res/drawable/rounded_bg_top.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/packages/SystemUI/res/layout/controls_detail_dialog.xml b/packages/SystemUI/res/layout/controls_detail_dialog.xml index f2de45a57ff64..34b603f4bc3d1 100644 --- a/packages/SystemUI/res/layout/controls_detail_dialog.xml +++ b/packages/SystemUI/res/layout/controls_detail_dialog.xml @@ -15,9 +15,76 @@ limitations under the License. --> - + android:layout_height="match_parent" + android:layout_marginTop="@dimen/controls_activity_view_top_offset" + android:orientation="vertical"> + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 6a8a4b9ac2fd0..2a4d5ef921f7a 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1250,6 +1250,12 @@ 2dp 3dp + + 25dp + 12dp + 200dp + 17sp + 48dp 8dp diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 3e02b30c376b4..118aa5b3f96ab 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -671,6 +671,19 @@ @*android:string/config_bodyFontFamily + + + + +