summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-05-11 17:27:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-11 17:28:00 +0000
commitb7c9b2259f1976e2fd25771aa9ca3dd8f3afa335 (patch)
tree4b355f31d1f2493d47fe7f69fb4dd988ce76399c /packages/SystemUI
parent3dec0d47215b56e3bd3e6f3287cf2c966bf8c22f (diff)
parent20c8905869c9e1cef075c87ea473917994247b06 (diff)
downloadframeworks_base-b7c9b2259f1976e2fd25771aa9ca3dd8f3afa335.zip
frameworks_base-b7c9b2259f1976e2fd25771aa9ca3dd8f3afa335.tar.gz
frameworks_base-b7c9b2259f1976e2fd25771aa9ca3dd8f3afa335.tar.bz2
Merge "QS: Defer tile view updates when opening the detail panel." into mnc-dev
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);
}
}