From ff92353f27e851c0ffd2bc3c08d76f144015a6b8 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 8 Apr 2020 13:35:21 -0700 Subject: Calculate spacers properly The number of spacers should be how many tiles we can fit, minus how many we have. Bug: 152628601 Test: manual Change-Id: I7cddaba3282068ab6f059baff5ad774ae9bf8b11 --- .../src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 208d9117e088..f439eac9f96a 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt @@ -370,7 +370,7 @@ class ControlsUiControllerImpl @Inject constructor ( } // add spacers if necessary to keep control size consistent - var spacersToAdd = selectedStructure.controls.size % maxColumns + var spacersToAdd = maxColumns - (selectedStructure.controls.size % maxColumns) while (spacersToAdd > 0) { lastRow.addView(Space(context), LinearLayout.LayoutParams(0, 0, 1f)) spacersToAdd-- -- cgit v1.2.3-59-g8ed1b