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

Commit 9a391afb authored by Sreyas Rangaraju's avatar Sreyas Rangaraju Committed by Android (Google) Code Review
Browse files

Merge "Fix Task Icon menu behavior." into ub-launcher3-rvc-dev

parents ba0a6b61 b64b59d0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -607,6 +607,17 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        }
    }

    /**
     * Whether the Clear All button is hidden or fully visible. Used to determine if center
     * displayed page is a task or the Clear All button.
     *
     * @return True = Clear All button not fully visible, center page is a task. False = Clear All
     * button fully visible, center page is Clear All button.
     */
    public boolean isClearAllHidden() {
        return mClearAllButton.getAlpha() != 1f;
    }

    @Override
    protected void onPageBeginTransition() {
        super.onPageBeginTransition();
@@ -616,7 +627,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    @Override
    protected void onPageEndTransition() {
        super.onPageEndTransition();
        if (getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen())) {
        if (isClearAllHidden()) {
            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().isClearAllHidden()) {
            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;
    }