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) {
|
public boolean onTouch(View v, MotionEvent ev) {
|
||||||
int action = ev.getAction() & MotionEvent.ACTION_MASK;
|
int action = ev.getAction() & MotionEvent.ACTION_MASK;
|
||||||
if (action == MotionEvent.ACTION_DOWN) {
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
mHandler.post(mPreloadTasksRunnable);
|
preloadRecentTasksList();
|
||||||
} else if (action == MotionEvent.ACTION_CANCEL) {
|
} else if (action == MotionEvent.ACTION_CANCEL) {
|
||||||
cancelLoadingThumbnailsAndIcons();
|
cancelPreloadingRecentTasksList();
|
||||||
mHandler.removeCallbacks(mPreloadTasksRunnable);
|
|
||||||
} else if (action == MotionEvent.ACTION_UP) {
|
} else if (action == MotionEvent.ACTION_UP) {
|
||||||
// Remove the preloader if we haven't called it yet
|
// Remove the preloader if we haven't called it yet
|
||||||
mHandler.removeCallbacks(mPreloadTasksRunnable);
|
mHandler.removeCallbacks(mPreloadTasksRunnable);
|
||||||
@@ -268,6 +267,15 @@ public class RecentTasksLoader implements View.OnTouchListener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void preloadRecentTasksList() {
|
||||||
|
mHandler.post(mPreloadTasksRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancelPreloadingRecentTasksList() {
|
||||||
|
cancelLoadingThumbnailsAndIcons();
|
||||||
|
mHandler.removeCallbacks(mPreloadTasksRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
public void cancelLoadingThumbnailsAndIcons(RecentsPanelView caller) {
|
public void cancelLoadingThumbnailsAndIcons(RecentsPanelView caller) {
|
||||||
// Only oblige this request if it comes from the current RecentsPanel
|
// Only oblige this request if it comes from the current RecentsPanel
|
||||||
// (eg when you rotate, the old RecentsPanel request should be ignored)
|
// (eg when you rotate, the old RecentsPanel request should be ignored)
|
||||||
|
|||||||
@@ -594,25 +594,11 @@ public abstract class BaseStatusBar extends SystemUI implements
|
|||||||
break;
|
break;
|
||||||
case MSG_PRELOAD_RECENT_APPS:
|
case MSG_PRELOAD_RECENT_APPS:
|
||||||
if (DEBUG) Slog.d(TAG, "preloading recents");
|
if (DEBUG) Slog.d(TAG, "preloading recents");
|
||||||
{
|
getRecentTasksLoader().preloadRecentTasksList();
|
||||||
// TODO:
|
|
||||||
// need to implement this
|
|
||||||
//final RecentsPanelView recentsPanel = getRecentsPanel();
|
|
||||||
//if (recentsPanel != null) {
|
|
||||||
//recentsPanel.preloadRecentTasksList();
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MSG_CANCEL_PRELOAD_RECENT_APPS:
|
case MSG_CANCEL_PRELOAD_RECENT_APPS:
|
||||||
if (DEBUG) Slog.d(TAG, "cancel preloading recents");
|
if (DEBUG) Slog.d(TAG, "cancel preloading recents");
|
||||||
{
|
getRecentTasksLoader().cancelPreloadingRecentTasksList();
|
||||||
// TODO:
|
|
||||||
// need to implement this
|
|
||||||
//final RecentsPanelView recentsPanel = getRecentsPanel();
|
|
||||||
//if (recentsPanel != null) {
|
|
||||||
//recentsPanel.clearRecentTasksList();
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MSG_OPEN_SEARCH_PANEL:
|
case MSG_OPEN_SEARCH_PANEL:
|
||||||
if (DEBUG) Slog.d(TAG, "opening search panel");
|
if (DEBUG) Slog.d(TAG, "opening search panel");
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ public class TabletStatusBar extends BaseStatusBar implements
|
|||||||
|
|
||||||
mWindowManager.addView(mCompatModePanel, lp);
|
mWindowManager.addView(mCompatModePanel, lp);
|
||||||
|
|
||||||
//mRecentButton.setOnTouchListener(mRecentsPanel); //TODO: plumb this
|
mRecentButton.setOnTouchListener(getRecentTasksLoader());
|
||||||
|
|
||||||
mPile = (NotificationRowLayout)mNotificationPanel.findViewById(R.id.content);
|
mPile = (NotificationRowLayout)mNotificationPanel.findViewById(R.id.content);
|
||||||
mPile.removeAllViews();
|
mPile.removeAllViews();
|
||||||
|
|||||||
Reference in New Issue
Block a user