summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-10-27 12:54:39 -0700
committerMichael Jurka <mikejurka@google.com>2011-10-27 13:09:24 -0700
commit5571ab2d47c434abf57621d7502fcf4850bb477e (patch)
treeef2bb8925d345ee11b4d8b1c97acd4bfda22b1ae /packages
parent27812a8f14ca22f0a709320e5a41d200ac59b63b (diff)
downloadframeworks_base-5571ab2d47c434abf57621d7502fcf4850bb477e.zip
frameworks_base-5571ab2d47c434abf57621d7502fcf4850bb477e.tar.gz
frameworks_base-5571ab2d47c434abf57621d7502fcf4850bb477e.tar.bz2
Fix recents button on large devices (5490265)
- Also, delay preloading recents so that we get haptic feedback immediately (5507038) Change-Id: I8a22ad719493bd9cfec0ef56d09949b164c1451b
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java5
2 files changed, 24 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 343b33514..6b8b65e 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -75,6 +75,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
private RecentTasksLoader mRecentTasksLoader;
private ArrayList<TaskDescription> mRecentTaskDescriptions;
+ private Runnable mPreloadTasksRunnable;
private boolean mRecentTasksDirty = true;
private TaskDescriptionAdapter mListAdapter;
private int mThumbnailWidth;
@@ -198,10 +199,16 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
} else {
if (noApps) {
if (DEBUG) Log.v(TAG, "Nothing to show");
+ // Need to set recent tasks to dirty so that next time we load, we
+ // refresh the list of tasks
+ mRecentTasksLoader.cancelLoadingThumbnails();
+ mRecentTasksDirty = true;
return;
}
}
} else {
+ // Need to set recent tasks to dirty so that next time we load, we
+ // refresh the list of tasks
mRecentTasksLoader.cancelLoadingThumbnails();
mRecentTasksDirty = true;
}
@@ -361,6 +368,13 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
((BitmapDrawable) mRecentsScrim.getBackground()).setTileModeY(TileMode.REPEAT);
}
+
+ mPreloadTasksRunnable = new Runnable() {
+ public void run() {
+ setVisibility(INVISIBLE);
+ refreshRecentTasksList();
+ }
+ };
}
private void createCustomAnimations(LayoutTransition transitioner) {
@@ -446,14 +460,18 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
if (!mShowing) {
int action = ev.getAction() & MotionEvent.ACTION_MASK;
if (action == MotionEvent.ACTION_DOWN) {
- // If we set our visibility to INVISIBLE here, we avoid an extra call to onLayout
- // later when we become visible
- setVisibility(INVISIBLE);
- refreshRecentTasksList();
+ // If we set our visibility to INVISIBLE here, we avoid an extra call to
+ // onLayout later when we become visible (because onLayout is always called
+ // when going from GONE)
+ post(mPreloadTasksRunnable);
} else if (action == MotionEvent.ACTION_CANCEL) {
setVisibility(GONE);
clearRecentTasksList();
+ // Remove the preloader if we haven't called it yet
+ removeCallbacks(mPreloadTasksRunnable);
} else if (action == MotionEvent.ACTION_UP) {
+ // Remove the preloader if we haven't called it yet
+ removeCallbacks(mPreloadTasksRunnable);
if (!v.isPressed()) {
setVisibility(GONE);
clearRecentTasksList();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 00bdd44..e3f6bd4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -1262,9 +1262,8 @@ public class TabletStatusBar extends StatusBar implements
public void onClickRecentButton() {
if (DEBUG) Slog.d(TAG, "clicked recent apps; disabled=" + mDisabled);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) {
- int msg = (mRecentsPanel.getVisibility() == View.GONE)
- ? MSG_OPEN_RECENTS_PANEL
- : MSG_CLOSE_RECENTS_PANEL;
+ int msg = (mRecentsPanel.getVisibility() == View.VISIBLE)
+ ? MSG_CLOSE_RECENTS_PANEL : MSG_OPEN_RECENTS_PANEL;
mHandler.removeMessages(msg);
mHandler.sendEmptyMessage(msg);
}