Merge "Fix crash when there's only one QQS tile"
This commit is contained in:
committed by
Android (Google) Code Review
commit
51b2b84910
@@ -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