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

Commit 47c5a495 authored by Tony Wickham's avatar Tony Wickham
Browse files

Remove DisallowIntercept runnable from ShortcutsContainerListener.

This was copied from ForwardingListener, which was used to prevent
scrollable parents from intercepting swipe gestures. We only use
long press, so we don't want to do this.

Bug: 30230790
Change-Id: Icbb692c1b46ad8287af2942baa452f3578fee679
parent e9381d60
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ import android.os.SystemClock;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewParent;

import com.android.launcher3.BubbleTextView;
import com.android.launcher3.CheckLongPressHelper;
@@ -22,18 +21,12 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
    /** Scaled touch slop, used for detecting movement outside bounds. */
    private final float mScaledTouchSlop;

    /** Timeout before disallowing intercept on the source's parent. */
    private final int mTapTimeout;

    /** Timeout before accepting a long-press to start forwarding. */
    private final int mLongPressTimeout;

    /** Source view from which events are forwarded. */
    private final BubbleTextView mSrcIcon;

    /** Runnable used to prevent conflicts with scrolling parents. */
    private Runnable mDisallowIntercept;

    /** Runnable used to trigger forwarding on long-press. */
    private Runnable mTriggerLongPress;

@@ -56,7 +49,6 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
    public ShortcutsContainerListener(BubbleTextView icon) {
        mSrcIcon = icon;
        mScaledTouchSlop = ViewConfiguration.get(icon.getContext()).getScaledTouchSlop();
        mTapTimeout = ViewConfiguration.getTapTimeout();

        mLongPressTimeout = CheckLongPressHelper.DEFAULT_LONG_PRESS_TIMEOUT;

@@ -113,10 +105,6 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
    public void onViewDetachedFromWindow(View v) {
        mForwarding = false;
        mActivePointerId = MotionEvent.INVALID_POINTER_ID;

        if (mDisallowIntercept != null) {
            mSrcIcon.removeCallbacks(mDisallowIntercept);
        }
    }

    /**
@@ -158,11 +146,6 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
            case MotionEvent.ACTION_DOWN:
                mActivePointerId = srcEvent.getPointerId(0);

                if (mDisallowIntercept == null) {
                    mDisallowIntercept = new DisallowIntercept();
                }
                src.postDelayed(mDisallowIntercept, mTapTimeout);

                if (mTriggerLongPress == null) {
                    mTriggerLongPress = new TriggerLongPress();
                }
@@ -195,10 +178,6 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
        if (mTriggerLongPress != null) {
            mSrcIcon.removeCallbacks(mTriggerLongPress);
        }

        if (mDisallowIntercept != null) {
            mSrcIcon.removeCallbacks(mDisallowIntercept);
        }
    }

    private void onLongPress() {
@@ -265,14 +244,6 @@ public class ShortcutsContainerListener implements View.OnTouchListener,
        return handled && keepForwarding;
    }

    private class DisallowIntercept implements Runnable {
        @Override
        public void run() {
            final ViewParent parent = mSrcIcon.getParent();
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }

    private class TriggerLongPress implements Runnable {
        @Override
        public void run() {