Fix crash when there's only one QQS tile
Test: runtest & manual (adb) Change-Id: I5a48f69a0650fecea47e755bf0ba1124e1150db9 Fixes: 117101187
This commit is contained in:
@@ -253,7 +253,8 @@ public class QuickQSPanel extends QSPanel {
|
||||
|
||||
final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
|
||||
final int leftoverWithespace = availableWidth - maxTiles * mCellWidth;
|
||||
final int smallestHorizontalMarginNeeded = leftoverWithespace / (maxTiles - 1);
|
||||
final int smallestHorizontalMarginNeeded;
|
||||
smallestHorizontalMarginNeeded = leftoverWithespace / Math.max(1, maxTiles - 1);
|
||||
|
||||
if (smallestHorizontalMarginNeeded > 0){
|
||||
mCellMarginHorizontal = smallestHorizontalMarginNeeded;
|
||||
|
||||
Reference in New Issue
Block a user