summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-06-29 14:23:59 -0700
committerRoman Birg <roman@cyngn.com>2016-07-06 09:01:26 -0700
commit2ab71c1e6f60b0ab76208a1fd5963bac12f4aee8 (patch)
tree8a92eb2163a4cee8d09aa953f6267ab0d5fbd607 /packages/SystemUI
parent94c32d8bd375b79fab312081b4ff801683cf84e1 (diff)
downloadframeworks_base-2ab71c1e6f60b0ab76208a1fd5963bac12f4aee8.zip
frameworks_base-2ab71c1e6f60b0ab76208a1fd5963bac12f4aee8.tar.gz
frameworks_base-2ab71c1e6f60b0ab76208a1fd5963bac12f4aee8.tar.bz2
SystemUI: fix qstile page reset timeout
When the user hasn't visisted the quick settings tile area for some time (currently 10s), we need to reset the page back to the first one. We can't go off whether we are listening to events because when the user turns the screen off, listening is set to true, so the page would never reset if the user turned their screen off. We now key off whether we are expanded, which represents whether the user is interacting with the panel. Change-Id: I010aaa9e9ea84eb96308184dad606d47ce136748 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
index 4b9036e..3ec1b83 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
@@ -121,9 +121,10 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
private Runnable mResetPage = new Runnable() {
@Override
public void run() {
- if (!mListening) {
+ if (!mExpanded) {
// only reset when the user isn't interacting at all
mViewPager.setCurrentItem(0);
+ mPagerAdapter.notifyDataSetChanged();
}
}
};
@@ -386,12 +387,6 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
public void setListening(boolean listening) {
if (mListening == listening) return;
mListening = listening;
- // reset the page when inactive for a while
- if (listening) {
- removeCallbacks(mResetPage);
- } else {
- postDelayed(mResetPage, PAGE_RESET_DELAY);
- }
for (TileRecord r : mRecords) {
r.tile.setListening(mListening);
}
@@ -1824,6 +1819,12 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
@Override
public void setExpanded(boolean expanded) {
super.setExpanded(expanded);
+ // reset the page when inactive for a while
+ if (expanded) {
+ removeCallbacks(mResetPage);
+ } else {
+ postDelayed(mResetPage, PAGE_RESET_DELAY);
+ }
if (!expanded) {
if (mEditing) {
mHost.setEditing(false);