Improve transition when going to Wifi/BT detail panel
Animate the height change of the lower QS panel when going into
Wifi/BT or any other panel which is higher than the default size.
Bug: 18665311
Change-Id: Ic1d1f19183cf6b502d6b623388b315ed6e0a3c9f
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 91b1569..974235e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -67,8 +67,10 @@
private int mPanelPaddingBottom;
private int mDualTileUnderlap;
private int mBrightnessPaddingTop;
+ private int mGridHeight;
private boolean mExpanded;
private boolean mListening;
+ private boolean mClosingDetail;
private Record mDetailRecord;
private Callback mCallback;
@@ -320,6 +322,14 @@
showDetail(false, mDetailRecord);
}
+ public boolean isClosingDetail() {
+ return mClosingDetail;
+ }
+
+ public int getGridHeight() {
+ return mGridHeight;
+ }
+
private void handleShowDetail(Record r, boolean show) {
if (r instanceof TileRecord) {
handleShowDetailTile((TileRecord) r, show);
@@ -364,6 +374,7 @@
setDetailRecord(r);
listener = mHideGridContentWhenDone;
} else {
+ mClosingDetail = true;
setGridContentVisibility(true);
listener = mTeardownDetailWhenDone;
fireScanStateChanged(false);
@@ -426,6 +437,7 @@
if (mDetail.getMeasuredHeight() < h) {
mDetail.measure(exactly(width), exactly(h));
}
+ mGridHeight = h;
setMeasuredDimension(width, Math.max(h, mDetail.getMeasuredHeight()));
}
@@ -537,6 +549,7 @@
public void onAnimationEnd(Animator animation) {
mDetailContent.removeAllViews();
setDetailRecord(null);
+ mClosingDetail = false;
};
};