Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 208e1a15 authored by Michael Jurka's avatar Michael Jurka Committed by Android Git Automerger
Browse files

am c4f09e03: Merge "Fix recents button on large devices (5490265)" into ics-mr1

* commit 'c4f09e03':
  Fix recents button on large devices (5490265)
parents d1785003 c4f09e03
Loading
Loading
Loading
Loading
+22 −4
Original line number Original line Diff line number Diff line
@@ -75,6 +75,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe


    private RecentTasksLoader mRecentTasksLoader;
    private RecentTasksLoader mRecentTasksLoader;
    private ArrayList<TaskDescription> mRecentTaskDescriptions;
    private ArrayList<TaskDescription> mRecentTaskDescriptions;
    private Runnable mPreloadTasksRunnable;
    private boolean mRecentTasksDirty = true;
    private boolean mRecentTasksDirty = true;
    private TaskDescriptionAdapter mListAdapter;
    private TaskDescriptionAdapter mListAdapter;
    private int mThumbnailWidth;
    private int mThumbnailWidth;
@@ -198,10 +199,16 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
            } else {
            } else {
                if (noApps) {
                if (noApps) {
                    if (DEBUG) Log.v(TAG, "Nothing to show");
                    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;
                    return;
                }
                }
            }
            }
        } else {
        } else {
            // Need to set recent tasks to dirty so that next time we load, we
            // refresh the list of tasks
            mRecentTasksLoader.cancelLoadingThumbnails();
            mRecentTasksLoader.cancelLoadingThumbnails();
            mRecentTasksDirty = true;
            mRecentTasksDirty = true;
        }
        }
@@ -361,6 +368,13 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
        if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
        if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
            ((BitmapDrawable) mRecentsScrim.getBackground()).setTileModeY(TileMode.REPEAT);
            ((BitmapDrawable) mRecentsScrim.getBackground()).setTileModeY(TileMode.REPEAT);
        }
        }

        mPreloadTasksRunnable = new Runnable() {
            public void run() {
                setVisibility(INVISIBLE);
                refreshRecentTasksList();
            }
        };
    }
    }


    private void createCustomAnimations(LayoutTransition transitioner) {
    private void createCustomAnimations(LayoutTransition transitioner) {
@@ -446,14 +460,18 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
        if (!mShowing) {
        if (!mShowing) {
            int action = ev.getAction() & MotionEvent.ACTION_MASK;
            int action = ev.getAction() & MotionEvent.ACTION_MASK;
            if (action == MotionEvent.ACTION_DOWN) {
            if (action == MotionEvent.ACTION_DOWN) {
                // If we set our visibility to INVISIBLE here, we avoid an extra call to onLayout
                // If we set our visibility to INVISIBLE here, we avoid an extra call to
                // later when we become visible
                // onLayout later when we become visible (because onLayout is always called
                setVisibility(INVISIBLE);
                // when going from GONE)
                refreshRecentTasksList();
                post(mPreloadTasksRunnable);
            } else if (action == MotionEvent.ACTION_CANCEL) {
            } else if (action == MotionEvent.ACTION_CANCEL) {
                setVisibility(GONE);
                setVisibility(GONE);
                clearRecentTasksList();
                clearRecentTasksList();
                // Remove the preloader if we haven't called it yet
                removeCallbacks(mPreloadTasksRunnable);
            } else if (action == MotionEvent.ACTION_UP) {
            } else if (action == MotionEvent.ACTION_UP) {
                // Remove the preloader if we haven't called it yet
                removeCallbacks(mPreloadTasksRunnable);
                if (!v.isPressed()) {
                if (!v.isPressed()) {
                    setVisibility(GONE);
                    setVisibility(GONE);
                    clearRecentTasksList();
                    clearRecentTasksList();
+2 −3
Original line number Original line Diff line number Diff line
@@ -1262,9 +1262,8 @@ public class TabletStatusBar extends StatusBar implements
    public void onClickRecentButton() {
    public void onClickRecentButton() {
        if (DEBUG) Slog.d(TAG, "clicked recent apps; disabled=" + mDisabled);
        if (DEBUG) Slog.d(TAG, "clicked recent apps; disabled=" + mDisabled);
        if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) {
        if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) {
            int msg = (mRecentsPanel.getVisibility() == View.GONE)
            int msg = (mRecentsPanel.getVisibility() == View.VISIBLE)
                ? MSG_OPEN_RECENTS_PANEL
                ? MSG_CLOSE_RECENTS_PANEL : MSG_OPEN_RECENTS_PANEL;
                : MSG_CLOSE_RECENTS_PANEL;
            mHandler.removeMessages(msg);
            mHandler.removeMessages(msg);
            mHandler.sendEmptyMessage(msg);
            mHandler.sendEmptyMessage(msg);
        }
        }