From 9e0abbb7b88b18a663c15ae6146a6ebaa06f251d Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 7 Jun 2021 15:49:53 -0400 Subject: [PATCH] Controls - UX spacing tweaks UX polish to match latest guidance. More spacing, more rounded corners. Fixes: 190089614 Test: manual (controls main activity + add/edit controls) Change-Id: Ia030b491ec594e358b11f3e53e287328ad3cc7bf --- packages/SystemUI/res/layout/controls_base_item.xml | 3 +-- packages/SystemUI/res/values/dimens.xml | 8 ++++---- .../systemui/controls/ui/ControlsUiControllerImpl.kt | 6 ++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index 5f83f45958e94..5d80da8cb9aae 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -25,8 +25,7 @@ android:focusable="true" android:screenReaderFocusable="true" android:stateListAnimator="@anim/control_state_list_animator" - android:layout_marginLeft="@dimen/control_base_item_margin" - android:layout_marginRight="@dimen/control_base_item_margin" + android:layout_marginStart="@dimen/control_spacing" android:background="@drawable/control_background"> 20dp 14sp 24dp - 4dp + 8dp 1dp - 12dp - 106dp + 14dp + 104dp 12dp 4dp 14sp 18sp - 2dp + 4dp 3dp 5% 40% 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 821a171e883c3..af7089296bca5 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt @@ -399,6 +399,12 @@ class ControlsUiControllerImpl @Inject constructor ( val baseLayout = inflater.inflate( R.layout.controls_base_item, lastRow, false) as ViewGroup lastRow.addView(baseLayout) + + // Use ConstraintLayout in the future... for now, manually adjust margins + if (lastRow.getChildCount() == 1) { + val lp = baseLayout.getLayoutParams() as ViewGroup.MarginLayoutParams + lp.setMarginStart(0) + } val cvh = ControlViewHolder( baseLayout, controlsController.get(),