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

Commit 1697b79a authored by Adam Cohen's avatar Adam Cohen
Browse files

Fixing up click / long click to enter / exit overview mode

Change-Id: I1ec7ab7f3e5c67add9ae64901e0ea377e265ed84
parent f82f344a
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -2175,9 +2175,9 @@ public class Launcher extends Activity
            return;
        }

        if (v instanceof PageIndicator) {
            if (!mWorkspace.isInOverviewMode()) {
                mWorkspace.enterOverviewMode();
        if (v instanceof Workspace) {
            if (mWorkspace.isInOverviewMode()) {
                mWorkspace.exitOverviewMode(true);
            }
            return;
        }
@@ -2589,6 +2589,15 @@ public class Launcher extends Activity
        if (isWorkspaceLocked()) return false;
        if (mState != State.WORKSPACE) return false;

        if (v instanceof Workspace) {
            if (!mWorkspace.isInOverviewMode()) {
                mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
                        HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
                mWorkspace.enterOverviewMode();
            }
            return true;
        }

        if (!(v instanceof CellLayout)) {
            v = (View) v.getParent().getParent();
        }
+6 −2
Original line number Diff line number Diff line
@@ -341,7 +341,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
            }

            mPageIndicator.addMarkers(markers, mAllowPagedViewAnimations);
            mPageIndicator.setOnClickListener((Launcher) getContext());
        }
    }

@@ -585,6 +584,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        for (int i = 0; i < count; i++) {
            getPageAt(i).setOnLongClickListener(l);
        }
        super.setOnLongClickListener(l);
    }

    @Override
@@ -1591,6 +1591,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
            return false;
        }

        super.onTouchEvent(ev);

        // Skip touch handling if there are no pages to swipe
        if (getChildCount() <= 0) return super.onTouchEvent(ev);

@@ -1886,7 +1888,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        mActivePointerId = INVALID_POINTER;
    }

    protected void onUnhandledTap(MotionEvent ev) {}
    protected void onUnhandledTap(MotionEvent ev) {
        ((Launcher) getContext()).onClick(this);
    }

    @Override
    public boolean onGenericMotionEvent(MotionEvent event) {