summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-04-09 21:04:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-04-09 21:04:18 +0000
commit6813206e6c2fb85da1959840ca6eee54cebe23bd (patch)
tree6088ba06677cb6da9bc1892c38f4742c2992732e
parenta0caf8fad9c18c9b04d8ab41d89dcec8a3f48d09 (diff)
parent1ffaf8c28e4106b3113df16df811eec8c8df1fbc (diff)
Merge "Fix calculation of empty spaces" into rvc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt3
1 files changed, 2 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 02c6ff68450e..934a69508d68 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
@@ -429,7 +429,8 @@ class ControlsUiControllerImpl @Inject constructor (
}
// add spacers if necessary to keep control size consistent
- var spacersToAdd = maxColumns - (selectedStructure.controls.size % maxColumns)
+ val mod = selectedStructure.controls.size % maxColumns
+ var spacersToAdd = if (mod == 0) 0 else maxColumns - mod
while (spacersToAdd > 0) {
lastRow.addView(Space(context), LinearLayout.LayoutParams(0, 0, 1f))
spacersToAdd--