am 78770167: Merge "Fixing preloading recents for all devices" into jb-mr1-dev
* commit '78770167cec711e6259734c18cd17ad248eea759': Fixing preloading recents for all devices
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user