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

Commit 0b856496 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix last tile bottom calculation

Use the unoverriden height for tiles (only relevant for tiles in QS
while expanding for QQS). This way, we get the bottom after animations
will be finished.

Test: manual, with media and in split shade
Fixes: 231399422
Change-Id: Ib67dcb09e3b97ea3dbb27a92d2a14bc00fc64b6e
parent 46e3f921
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
    private int mMaxColumns = NO_MAX_COLUMNS;
    protected int mResourceColumns;
    private float mSquishinessFraction = 1f;
    private int mLastTileBottom;
    protected int mLastTileBottom;

    public TileLayout(Context context) {
        this(context, null);
@@ -243,14 +243,13 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
                record.tileView.setLeftTopRightBottom(left, top, right, bottom);
            }
            record.tileView.setPosition(i);
            if (forLayout) {
                mLastTileBottom = record.tileView.getBottom();
            } else {

            // Set the bottom to the unoverriden squished bottom. This is to avoid fake bottoms that
            // are only used for QQS -> QS expansion animations
            float scale = QSTileViewImplKt.constrainSquishiness(mSquishinessFraction);
            mLastTileBottom = top + (int) (record.tileView.getMeasuredHeight() * scale);
        }
    }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
@@ -258,7 +257,8 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
    }

    protected int getRowTop(int row) {
        return (int) (row * (mCellHeight * mSquishinessFraction + mCellMarginVertical));
        float scale = QSTileViewImplKt.constrainSquishiness(mSquishinessFraction);
        return (int) (row * (mCellHeight * scale + mCellMarginVertical));
    }

    protected int getColumnStart(int column) {