Merge "Remove last row bottom padding in QS" into sc-dev am: 49ed060f04

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15188484

Change-Id: Idf622e619e2ddcc17f1d21d1debc066f2b63f042
This commit is contained in:
Fabian Kozynski
2021-07-02 21:18:22 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ public class QuickQSPanel extends QSPanel {
LayoutParams.WRAP_CONTENT); LayoutParams.WRAP_CONTENT);
setLayoutParams(lp); setLayoutParams(lp);
setMaxColumns(4); setMaxColumns(4);
mLastRowPadding = true;
} }
@Override @Override

View File

@@ -31,6 +31,7 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
protected int mCellMarginVertical; protected int mCellMarginVertical;
protected int mSidePadding; protected int mSidePadding;
protected int mRows = 1; protected int mRows = 1;
protected boolean mLastRowPadding = false;
protected final ArrayList<TileRecord> mRecords = new ArrayList<>(); protected final ArrayList<TileRecord> mRecords = new ArrayList<>();
protected boolean mListening; protected boolean mListening;
@@ -167,6 +168,10 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
} }
int height = (mCellHeight + mCellMarginVertical) * mRows; int height = (mCellHeight + mCellMarginVertical) * mRows;
if (!mLastRowPadding) {
height -= mCellMarginVertical;
}
if (height < 0) height = 0; if (height < 0) height = 0;
setMeasuredDimension(width, height); setMeasuredDimension(width, height);