I have the following hierarchy: [Activity] -> [PopupWindow] -> [CustomView].
My the PopupWindow
itself is a square, but transparent, so you can see the Activity sitting in the background. The CustomView
is a circle embedded inside the PopupWindow.
What I have achieved so far is
- User clicks on green circle and I invoke "some stuff"
- User clicks outside of the
PopupWindow
and the touch event gets dispatched to the Activity.
The missing part is now, to dispatch any touch event that happens inside the PopupWindow
but outside the CustomView
(circle) to the Activity.
I already know how to sense when the touch is outside of my circle. I just have problems delegating it to the Activity.
In my CustomView
I have the following in onTouch
if (radiusTouch > maxRadius) {
return false;
}
In my PopupWindow
I already setup the following, but it gets never called:
popup.setTouchInterceptor(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.i(TAG, "PopupWindow :: onTouch()");
return false;
}
});
Anything else I have to do to delegate the touch event all the way to the Activity?