Merge "Prevent QSPanel from remeasuring" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
acc44b21a6
@@ -111,13 +111,25 @@ public class QSContainerImpl extends FrameLayout {
|
|||||||
+ mQSPanel.getMeasuredHeight() + getPaddingBottom();
|
+ mQSPanel.getMeasuredHeight() + getPaddingBottom();
|
||||||
super.onMeasure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
super.onMeasure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
||||||
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
|
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
|
||||||
|
|
||||||
// QSCustomizer will always be the height of the screen, but do this after
|
// QSCustomizer will always be the height of the screen, but do this after
|
||||||
// other measuring to avoid changing the height of the QS.
|
// other measuring to avoid changing the height of the QS.
|
||||||
mQSCustomizer.measure(widthMeasureSpec,
|
mQSCustomizer.measure(widthMeasureSpec,
|
||||||
MeasureSpec.makeMeasureSpec(getDisplayHeight(), MeasureSpec.EXACTLY));
|
MeasureSpec.makeMeasureSpec(getDisplayHeight(), MeasureSpec.EXACTLY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed,
|
||||||
|
int parentHeightMeasureSpec, int heightUsed) {
|
||||||
|
// Do not measure QSPanel again when doing super.onMeasure.
|
||||||
|
// This prevents the pages in PagedTileLayout to be remeasured with a different (incorrect)
|
||||||
|
// size to the one used for determining the number of rows and then the number of pages.
|
||||||
|
if (child != mQSPanel) {
|
||||||
|
super.measureChildWithMargins(child, parentWidthMeasureSpec, widthUsed,
|
||||||
|
parentHeightMeasureSpec, heightUsed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||||
super.onLayout(changed, left, top, right, bottom);
|
super.onLayout(changed, left, top, right, bottom);
|
||||||
|
|||||||
Reference in New Issue
Block a user