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(),