diff options
author | Michael Jurka <mikejurka@google.com> | 2012-09-05 05:50:30 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-05 05:50:30 -0700 |
commit | 3f5d3757967398fb32fb766e4a3f3c8ea9c624fc (patch) | |
tree | 6352f5ea034b7f9d4b475bda8e654ef0ca9b39ef /packages | |
parent | c7a27d077541bf0df353a78f0ae579a56620cc20 (diff) | |
parent | 447e03f5e123daafb3a4f8d9684e92d86ad963ab (diff) | |
download | frameworks_base-3f5d3757967398fb32fb766e4a3f3c8ea9c624fc.zip frameworks_base-3f5d3757967398fb32fb766e4a3f3c8ea9c624fc.tar.gz frameworks_base-3f5d3757967398fb32fb766e4a3f3c8ea9c624fc.tar.bz2 |
am 447e03f5: am 78770167: Merge "Fixing preloading recents for all devices" into jb-mr1-dev
* commit '447e03f5e123daafb3a4f8d9684e92d86ad963ab':
Fixing preloading recents for all devices
Diffstat (limited to 'packages')
3 files changed, 14 insertions, 20 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java index 880bdc0..6d84350 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java @@ -253,10 +253,9 @@ public class RecentTasksLoader implements View.OnTouchListener { public boolean onTouch(View v, MotionEvent ev) { int action = ev.getAction() & MotionEvent.ACTION_MASK; if (action == MotionEvent.ACTION_DOWN) { - mHandler.post(mPreloadTasksRunnable); + preloadRecentTasksList(); } else if (action == MotionEvent.ACTION_CANCEL) { - cancelLoadingThumbnailsAndIcons(); - mHandler.removeCallbacks(mPreloadTasksRunnable); + cancelPreloadingRecentTasksList(); } else if (action == MotionEvent.ACTION_UP) { // Remove the preloader if we haven't called it yet mHandler.removeCallbacks(mPreloadTasksRunnable); @@ -268,6 +267,15 @@ public class RecentTasksLoader implements View.OnTouchListener { return false; } + public void preloadRecentTasksList() { + mHandler.post(mPreloadTasksRunnable); + } + + public void cancelPreloadingRecentTasksList() { + cancelLoadingThumbnailsAndIcons(); + mHandler.removeCallbacks(mPreloadTasksRunnable); + } + public void cancelLoadingThumbnailsAndIcons(RecentsPanelView caller) { // Only oblige this request if it comes from the current RecentsPanel // (eg when you rotate, the old RecentsPanel request should be ignored) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 832cf88..97034bb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -594,25 +594,11 @@ public abstract class BaseStatusBar extends SystemUI implements break; case MSG_PRELOAD_RECENT_APPS: if (DEBUG) Slog.d(TAG, "preloading recents"); - { - // TODO: - // need to implement this - //final RecentsPanelView recentsPanel = getRecentsPanel(); - //if (recentsPanel != null) { - //recentsPanel.preloadRecentTasksList(); - //} - } + getRecentTasksLoader().preloadRecentTasksList(); break; case MSG_CANCEL_PRELOAD_RECENT_APPS: if (DEBUG) Slog.d(TAG, "cancel preloading recents"); - { - // TODO: - // need to implement this - //final RecentsPanelView recentsPanel = getRecentsPanel(); - //if (recentsPanel != null) { - //recentsPanel.clearRecentTasksList(); - //} - } + getRecentTasksLoader().cancelPreloadingRecentTasksList(); break; case MSG_OPEN_SEARCH_PANEL: if (DEBUG) Slog.d(TAG, "opening search panel"); 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 8ca3a9c..7153ec7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -355,7 +355,7 @@ public class TabletStatusBar extends BaseStatusBar implements mWindowManager.addView(mCompatModePanel, lp); - //mRecentButton.setOnTouchListener(mRecentsPanel); //TODO: plumb this + mRecentButton.setOnTouchListener(getRecentTasksLoader()); mPile = (NotificationRowLayout)mNotificationPanel.findViewById(R.id.content); mPile.removeAllViews(); |