diff options
16 files changed, 70 insertions, 22 deletions
diff --git a/packages/SystemUI/res-keyguard/drawable/controls_list_divider.xml b/packages/SystemUI/res-keyguard/drawable/controls_list_divider.xml new file mode 100644 index 000000000000..2fb722248229 --- /dev/null +++ b/packages/SystemUI/res-keyguard/drawable/controls_list_divider.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@color/transparent" /> + <size + android:width="@dimen/control_list_horizontal_spacing" + android:height="@dimen/control_list_vertical_spacing" /> +</shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/controls_list_divider.xml b/packages/SystemUI/res/drawable/global_actions_list_divider.xml index f8211d5297f3..f8211d5297f3 100644 --- a/packages/SystemUI/res/drawable/controls_list_divider.xml +++ b/packages/SystemUI/res/drawable/global_actions_list_divider.xml diff --git a/packages/SystemUI/res/drawable/controls_list_divider_inset.xml b/packages/SystemUI/res/drawable/global_actions_list_divider_inset.xml index ddfa18c53db9..170bc0def305 100644 --- a/packages/SystemUI/res/drawable/controls_list_divider_inset.xml +++ b/packages/SystemUI/res/drawable/global_actions_list_divider_inset.xml @@ -15,6 +15,6 @@ --> <inset xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/controls_list_divider" + android:drawable="@drawable/global_actions_list_divider" android:insetRight="@dimen/control_spinner_padding_horizontal" android:insetLeft="@dimen/control_spinner_padding_horizontal" /> diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index e1dbe695bd0e..f1939bb278e8 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -25,7 +25,6 @@ android:focusable="true" android:screenReaderFocusable="true" android:stateListAnimator="@anim/control_state_list_animator" - android:layout_marginStart="@dimen/control_spacing" android:background="@drawable/control_background"> <ImageView diff --git a/packages/SystemUI/res/layout/controls_list_view.xml b/packages/SystemUI/res/layout/controls_list_view.xml new file mode 100644 index 000000000000..2831cbfce043 --- /dev/null +++ b/packages/SystemUI/res/layout/controls_list_view.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/controls_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:divider="@drawable/controls_list_divider" + android:orientation="vertical" + android:showDividers="middle" />
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/controls_row.xml b/packages/SystemUI/res/layout/controls_row.xml index 4cc461a28187..4923b053aa2f 100644 --- a/packages/SystemUI/res/layout/controls_row.xml +++ b/packages/SystemUI/res/layout/controls_row.xml @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="horizontal" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/control_spacing" /> + android:divider="@drawable/controls_list_divider" + android:orientation="horizontal" + android:showDividers="middle" /> diff --git a/packages/SystemUI/res/layout/controls_with_favorites.xml b/packages/SystemUI/res/layout/controls_with_favorites.xml index b1259e48f7f7..c60fb2660462 100644 --- a/packages/SystemUI/res/layout/controls_with_favorites.xml +++ b/packages/SystemUI/res/layout/controls_with_favorites.xml @@ -20,7 +20,7 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/controls_header_menu_size" android:paddingHorizontal="@dimen/controls_header_horizontal_padding" android:layout_marginBottom="@dimen/controls_header_bottom_margin" android:orientation="horizontal"> @@ -85,10 +85,11 @@ android:layout_weight="1" android:clipChildren="true" android:orientation="vertical" - android:paddingHorizontal="16dp" + android:padding="@dimen/controls_content_padding" + android:background="@drawable/controls_panel_background" android:scrollbars="none"> - <include layout="@layout/global_actions_controls_list_view" /> + <include layout="@layout/controls_list_view" /> </ScrollView> diff --git a/packages/SystemUI/res/layout/global_actions_controls_list_view.xml b/packages/SystemUI/res/layout/global_actions_controls_list_view.xml deleted file mode 100644 index e1c2611cc4d4..000000000000 --- a/packages/SystemUI/res/layout/global_actions_controls_list_view.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/global_actions_controls_list" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:layout_marginLeft="@dimen/global_actions_side_margin" - android:layout_marginRight="@dimen/global_actions_side_margin" />
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/global_actions_power_dialog.xml b/packages/SystemUI/res/layout/global_actions_power_dialog.xml index ff3f0fb74cd5..3456515de635 100644 --- a/packages/SystemUI/res/layout/global_actions_power_dialog.xml +++ b/packages/SystemUI/res/layout/global_actions_power_dialog.xml @@ -18,7 +18,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" - android:divider="@drawable/controls_list_divider" + android:divider="@drawable/global_actions_list_divider" android:showDividers="middle" /> diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index 1681f7a95bce..0667cd8b12d6 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -69,6 +69,9 @@ <dimen name="controls_header_horizontal_padding">12dp</dimen> <dimen name="controls_content_margin_horizontal">16dp</dimen> + <dimen name="controls_content_padding">16dp</dimen> + <dimen name="control_list_vertical_spacing">8dp</dimen> + <dimen name="control_list_horizontal_spacing">16dp</dimen> <!-- Rear Display Education dimens --> <dimen name="rear_display_animation_width">246dp</dimen> diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 2b1d9d6c2f10..7e892f7e4800 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -103,4 +103,7 @@ <dimen name="controls_header_horizontal_padding">12dp</dimen> <dimen name="controls_content_margin_horizontal">24dp</dimen> + <dimen name="controls_content_padding">24dp</dimen> + <dimen name="control_list_vertical_spacing">8dp</dimen> + <dimen name="control_list_horizontal_spacing">16dp</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw720dp/dimens.xml b/packages/SystemUI/res/values-sw720dp/dimens.xml index de913ace8fda..d74eca6e127d 100644 --- a/packages/SystemUI/res/values-sw720dp/dimens.xml +++ b/packages/SystemUI/res/values-sw720dp/dimens.xml @@ -24,6 +24,9 @@ <dimen name="controls_header_horizontal_padding">28dp</dimen> <dimen name="controls_content_margin_horizontal">40dp</dimen> + <dimen name="controls_content_padding">32dp</dimen> + <dimen name="control_list_vertical_spacing">16dp</dimen> + <dimen name="control_list_horizontal_spacing">16dp</dimen> <dimen name="large_screen_shade_header_height">56dp</dimen> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 9f4fc396ae55..e9422580ed54 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -195,7 +195,7 @@ <color name="control_primary_text">#E6FFFFFF</color> <color name="control_secondary_text">#99FFFFFF</color> <color name="control_default_foreground">@color/GM2_grey_500</color> - <color name="control_default_background">@color/GM2_grey_900</color> + <color name="control_default_background">#303134</color> <color name="control_spinner_dropdown">@*android:color/foreground_material_dark</color> <color name="control_more_vert">@*android:color/foreground_material_dark</color> <color name="control_enabled_light_background">#413C2D</color> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index de8287e5e8cb..9bee9725d747 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1238,6 +1238,7 @@ <dimen name="controls_header_app_icon_size">24dp</dimen> <dimen name="controls_top_margin">48dp</dimen> <dimen name="controls_content_margin_horizontal">0dp</dimen> + <dimen name="controls_content_padding">16dp</dimen> <dimen name="control_header_text_size">24sp</dimen> <dimen name="control_item_text_size">14sp</dimen> <dimen name="control_menu_item_text_size">16sp</dimen> @@ -1256,6 +1257,8 @@ <dimen name="control_chevron_icon_size">20dp</dimen> <dimen name="control_spacing">8dp</dimen> <dimen name="control_list_divider">1dp</dimen> + <dimen name="control_list_vertical_spacing">8dp</dimen> + <dimen name="control_list_horizontal_spacing">12dp</dimen> <dimen name="control_corner_radius">14dp</dimen> <dimen name="control_height">104dp</dimen> <dimen name="control_padding">12dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt index 4395e36243a5..89204eb90857 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt @@ -657,7 +657,7 @@ class ControlsUiControllerImpl @Inject constructor ( val maxColumns = ControlAdapter.findMaxColumns(activityContext.resources) - val listView = parent.requireViewById(R.id.global_actions_controls_list) as ViewGroup + val listView = parent.requireViewById(R.id.controls_list) as ViewGroup listView.removeAllViews() var lastRow: ViewGroup = createRow(inflater, listView) selectedStructure.controls.forEach { diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java index de67ba8a6ded..6d083f6c8bfd 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java @@ -87,7 +87,7 @@ public class GlobalActionsPopupMenu extends ListPopupWindow { if (mIsDropDownMode) { // use a divider listView.setDividerHeight(res.getDimensionPixelSize(R.dimen.control_list_divider)); - listView.setDivider(res.getDrawable(R.drawable.controls_list_divider_inset)); + listView.setDivider(res.getDrawable(R.drawable.global_actions_list_divider_inset)); } else { if (mAdapter == null) return; |