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

Commit f9adf16c authored by Doris Liu's avatar Doris Liu
Browse files

Fix for popuping being hard to dismiss

Bug: 8688503
Change-Id: I86f1451867d7606060e5f81fdd3b8b0af1e0a6d3
parent 9c48a6c3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -389,9 +389,7 @@ public class PhotoUI implements PieListener,
    }

    public boolean dispatchTouchEvent(MotionEvent m) {
        if (mPopup != null) {
            return mActivity.superDispatchTouchEvent(m);
        } else if (mGestures != null && mRenderOverlay != null) {
        if (mGestures != null && mRenderOverlay != null) {
            return mGestures.dispatchTouch(m);
        }
        return false;
@@ -462,6 +460,7 @@ public class PhotoUI implements PieListener,
                LayoutParams.WRAP_CONTENT);
        lp.gravity = Gravity.CENTER;
        ((FrameLayout) mRootView).addView(mPopup, lp);
        mGestures.addTouchReceiver(mPopup);
    }

    public void dismissPopup(boolean topPopupOnly) {
@@ -475,6 +474,7 @@ public class PhotoUI implements PieListener,
        }
        setShowMenu(fullScreen);
        if (mPopup != null) {
            mGestures.removeTouchReceiver(mPopup);
            ((FrameLayout) mRootView).removeView(mPopup);
            mPopup = null;
        }
+5 −0
Original line number Diff line number Diff line
@@ -128,6 +128,11 @@ public class PreviewGestures
        mReceivers.add(v);
    }

    public void removeTouchReceiver(View v) {
        if (mReceivers == null || v == null) return;
        mReceivers.remove(v);
    }

    public void addUnclickableArea(View v) {
        if (mUnclickableAreas == null) {
            mUnclickableAreas = new ArrayList<View>();
+3 −3
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
                LayoutParams.WRAP_CONTENT);
        lp.gravity = Gravity.CENTER;
        ((FrameLayout) mRootView).addView(mPopup, lp);
        mGestures.addTouchReceiver(mPopup);
    }

    public void dismissPopup(boolean topLevelOnly) {
@@ -308,6 +309,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
        }
        setShowMenu(fullScreen);
        if (mPopup != null) {
            mGestures.removeTouchReceiver(mPopup);
            ((FrameLayout) mRootView).removeView(mPopup);
            mPopup = null;
        }
@@ -486,10 +488,8 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
    }

    public boolean dispatchTouchEvent(MotionEvent m) {
        if (mPopup == null && mGestures != null && mRenderOverlay != null) {
        if (mGestures != null && mRenderOverlay != null) {
            return mGestures.dispatchTouch(m);
        } else if (mPopup != null) {
            return mActivity.superDispatchTouchEvent(m);
        }
        return false;
    }