summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2020-04-08 13:35:21 -0700
committer Lucas Dupin <dupin@google.com> 2020-04-08 13:37:03 -0700
commitff92353f27e851c0ffd2bc3c08d76f144015a6b8 (patch)
tree6115769f8994cd4870b2acb680f02592f44de430
parent6651da4348361c2c670c54524e647a186488bd24 (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt2
1 files changed, 1 insertions, 1 deletions
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--