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

Commit 6df0148b authored by Sreyas's avatar Sreyas
Browse files

Fix Task Icon menu behavior.

Tapping task icon will now show the scrim for rest of thumbnail and not snap to page that is already snapped to.
Pressing task icon from clear all will scroll to the page.

Bug: 158004853
Change-Id: I79d0a4ac5be3641c6bdf71c34dcbf136ddbbebd1
parent 1fdc6ce4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -607,6 +607,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        }
    }

    public boolean isCenterPageTask() {
        return getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen());
    }

    @Override
    protected void onPageBeginTransition() {
        super.onPageBeginTransition();
@@ -616,7 +620,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    @Override
    protected void onPageEndTransition() {
        super.onPageEndTransition();
        if (getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen())) {
        if (isCenterPageTask()) {
            LayoutUtils.setViewEnabled(mActionsView, true);
        }
        if (getNextPage() > 0) {
+10 −7
Original line number Diff line number Diff line
@@ -425,7 +425,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
    }

    private boolean showTaskMenu(int action) {
        if (!getRecentsView().isCenterPageTask()) {
            getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
        } else {
            mMenuView = TaskMenuView.showForTask(this);
            mActivity.getStatsLogManager().log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS, buildProto());
            UserEventDispatcher.newInstance(getContext()).logActionOnItem(action, Direction.NONE,
@@ -433,6 +435,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
            if (mMenuView != null) {
                mMenuView.addOnAttachStateChangeListener(mTaskMenuStateListener);
            }
        }
        return mMenuView != null;
    }