diff options
| author | 2019-04-22 14:30:59 -0400 | |
|---|---|---|
| committer | 2019-04-22 14:30:59 -0400 | |
| commit | dc23ef66d9355116de4958d3e8b8015a6f6faf44 (patch) | |
| tree | fe671b6f95c00e7511c3f96074aee0ce4694c5d5 | |
| parent | 18184f9c86565f27efa74b317ab464dee1c6b94c (diff) | |
Remove allocation from HeaderTileLayout#onLayout
Moved allocation of Rect to construction, and only bounds are modified
on layout.
Also fixed typo
Test: visual, expanding animation on large display
Fixes: 131093881
Change-Id: I92e14deee73820c5c21d7328d6a84b3115bb3c1f
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java index 995dc66d8214..4b5513726f7e 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java @@ -181,6 +181,7 @@ public class QuickQSPanel extends QSPanel { private static class HeaderTileLayout extends TileLayout { private boolean mListening; + private Rect mClippingBounds = new Rect(); public HeaderTileLayout(Context context) { super(context); @@ -219,8 +220,8 @@ public class QuickQSPanel extends QSPanel { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { // We only care about clipping on the right side - Rect bounds = new Rect(0, 0, r - l, 10000); - setClipBounds(bounds); + mClippingBounds.set(0, 0, r - l, 10000); + setClipBounds(mClippingBounds); calculateColumns(); @@ -252,9 +253,9 @@ public class QuickQSPanel extends QSPanel { } final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd(); - final int leftoverWithespace = availableWidth - maxTiles * mCellWidth; + final int leftoverWhitespace = availableWidth - maxTiles * mCellWidth; final int smallestHorizontalMarginNeeded; - smallestHorizontalMarginNeeded = leftoverWithespace / Math.max(1, maxTiles - 1); + smallestHorizontalMarginNeeded = leftoverWhitespace / Math.max(1, maxTiles - 1); if (smallestHorizontalMarginNeeded > 0){ mCellMarginHorizontal = smallestHorizontalMarginNeeded; |