Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d9f0cfd authored by Fabian Kozynski's avatar Fabian Kozynski Committed by android-build-merger
Browse files

Merge "Merge "Remove allocation from HeaderTileLayout#onLayout" into qt-dev...

Merge "Merge "Remove allocation from HeaderTileLayout#onLayout" into qt-dev am: aeb929a3" into qt-dev-plus-aosp
am: 8a8be295

Change-Id: I38db76b9b0e71b4f7f7b6895bcb656c0f49d09a1
parents d5315c41 8a8be295
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -181,6 +181,7 @@ public class QuickQSPanel extends QSPanel {
    private static class HeaderTileLayout extends TileLayout {
    private static class HeaderTileLayout extends TileLayout {


        private boolean mListening;
        private boolean mListening;
        private Rect mClippingBounds = new Rect();


        public HeaderTileLayout(Context context) {
        public HeaderTileLayout(Context context) {
            super(context);
            super(context);
@@ -219,8 +220,8 @@ public class QuickQSPanel extends QSPanel {
        @Override
        @Override
        protected void onLayout(boolean changed, int l, int t, int r, int b) {
        protected void onLayout(boolean changed, int l, int t, int r, int b) {
            // We only care about clipping on the right side
            // We only care about clipping on the right side
            Rect bounds = new Rect(0, 0, r - l, 10000);
            mClippingBounds.set(0, 0, r - l, 10000);
            setClipBounds(bounds);
            setClipBounds(mClippingBounds);


            calculateColumns();
            calculateColumns();


@@ -252,9 +253,9 @@ public class QuickQSPanel extends QSPanel {
            }
            }


            final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
            final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
            final int leftoverWithespace = availableWidth - maxTiles * mCellWidth;
            final int leftoverWhitespace = availableWidth - maxTiles * mCellWidth;
            final int smallestHorizontalMarginNeeded;
            final int smallestHorizontalMarginNeeded;
            smallestHorizontalMarginNeeded = leftoverWithespace / Math.max(1, maxTiles - 1);
            smallestHorizontalMarginNeeded = leftoverWhitespace / Math.max(1, maxTiles - 1);


            if (smallestHorizontalMarginNeeded > 0){
            if (smallestHorizontalMarginNeeded > 0){
                mCellMarginHorizontal = smallestHorizontalMarginNeeded;
                mCellMarginHorizontal = smallestHorizontalMarginNeeded;