summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-05-11 13:11:24 -0400
committerJohn Spurlock <jspurlock@google.com>2015-05-11 13:24:23 -0400
commit20c8905869c9e1cef075c87ea473917994247b06 (patch)
tree99d1db75ffe0636874e158d9333fe0bbe4f8fa72 /packages/SystemUI
parent77bb25af3dbf34b6c88549ae931b069a788316fc (diff)
downloadframeworks_base-20c8905869c9e1cef075c87ea473917994247b06.zip
frameworks_base-20c8905869c9e1cef075c87ea473917994247b06.tar.gz
frameworks_base-20c8905869c9e1cef075c87ea473917994247b06.tar.bz2
QS: Defer tile view updates when opening the detail panel.
Bug: 20916542 Change-Id: I8e367fb2f8274eafb8d142fbfb54bc9be66b7546
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java1
2 files changed, 23 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index f352849..ebb07a0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -247,6 +247,12 @@ public class QSPanel extends ViewGroup {
}
}
+ private void drawTile(TileRecord r, QSTile.State state) {
+ final int visibility = state.visible ? VISIBLE : GONE;
+ setTileVisibility(r.tileView, visibility);
+ r.tileView.onStateChanged(state);
+ }
+
private void addTile(final QSTile<?> tile) {
final TileRecord r = new TileRecord();
r.tile = tile;
@@ -255,9 +261,9 @@ public class QSPanel extends ViewGroup {
final QSTile.Callback callback = new QSTile.Callback() {
@Override
public void onStateChanged(QSTile.State state) {
- int visibility = state.visible ? VISIBLE : GONE;
- setTileVisibility(r.tileView, visibility);
- r.tileView.onStateChanged(state);
+ if (!r.openingDetail) {
+ drawTile(r, state);
+ }
}
@Override
public void onShowDetail(boolean show) {
@@ -372,6 +378,9 @@ public class QSPanel extends ViewGroup {
MetricsLogger.visible(mContext, detailAdapter.getMetricsCategory());
setDetailRecord(r);
listener = mHideGridContentWhenDone;
+ if (r instanceof TileRecord) {
+ ((TileRecord) r).openingDetail = true;
+ }
} else {
MetricsLogger.hidden(mContext, mDetailRecord.detailAdapter.getMetricsCategory());
mClosingDetail = true;
@@ -557,6 +566,7 @@ public class QSPanel extends ViewGroup {
int row;
int col;
boolean scanState;
+ boolean openingDetail;
}
private final AnimatorListenerAdapter mTeardownDetailWhenDone = new AnimatorListenerAdapter() {
@@ -572,6 +582,7 @@ public class QSPanel extends ViewGroup {
// If we have been cancelled, remove the listener so that onAnimationEnd doesn't get
// called, this will avoid accidentally turning off the grid when we don't want to.
animation.removeListener(this);
+ redrawTile();
};
@Override
@@ -579,6 +590,15 @@ public class QSPanel extends ViewGroup {
// Only hide content if still in detail state.
if (mDetailRecord != null) {
setGridContentVisibility(false);
+ redrawTile();
+ }
+ }
+
+ private void redrawTile() {
+ if (mDetailRecord instanceof TileRecord) {
+ final TileRecord tileRecord = (TileRecord) mDetailRecord;
+ tileRecord.openingDetail = false;
+ drawTile(tileRecord, tileRecord.tile.getState());
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 5e6083a..8205798 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -95,7 +95,6 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
} else {
int zen = Prefs.getInt(mContext, Prefs.Key.DND_FAVORITE_ZEN, Global.ZEN_MODE_ALARMS);
mController.setZen(zen, null, TAG);
- refreshState(zen); // this one's optimistic
showDetail(true);
}
}