diff options
| author | 2022-05-10 16:31:27 +0000 | |
|---|---|---|
| committer | 2022-05-10 16:31:27 +0000 | |
| commit | 29a2771b30640d59f73743287583d61bde019854 (patch) | |
| tree | 04d31abd23454dc078b53c527b6ccbda006421e2 | |
| parent | 2ec2deea7d53b46c739b14adfc51cf036afb6282 (diff) | |
| parent | 0b85649636563bd58cd5de64ed2019208d8a6c57 (diff) | |
Merge "Fix last tile bottom calculation" into tm-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/TileLayout.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java index 311ee56477de..3d00dd49cb1c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java +++ b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java @@ -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,12 +243,11 @@ 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 { - float scale = QSTileViewImplKt.constrainSquishiness(mSquishinessFraction); - mLastTileBottom = top + (int) (record.tileView.getMeasuredHeight() * scale); - } + + // 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); } } @@ -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) { |