I have created a class that extends popupwindow. its constructor looks something like the following
super(builder.context.get());
this.setWindowLayoutMode(V
SOLUTION
Register a touch interceptor for the Popupwindow. If you want the activity to handle it, assuming you have a reference to the activity, call someActivity.dispatchTouchEvent(someMotionEventPassedIntoTheTouchIntercepter);, if you want the popupwindow to handle the touch even, call someView.dispatchTouchEvent(theMotionEventPassedToTouchInterceptor) to the popupwindow's content view, as set in the popupwindows setContentView(someView) method.
My method specifically looked like the following
private OnTouchListener onTouchListener = new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
float x = event.getX();
float y = event.getY();
if (Math.pow(x - coordinates[0], 2) + Math.pow((y - coordinates[1]), 2) < Math.pow(
radius, 2)) {
activity.get().dispatchTouchEvent(event);
return false;
}
frameLayout.dispatchTouchEvent(event);
return true;
}
};