I have an Activity with a SlidingPaneLayout
, and inside there are two fragments: a ListView
on the left, and a MapFragment
on the right.
How is it possible to intercept the touch event generated so that the user can move the map without close the panel?
The only area that I would like to use to close/open the right panel is the first fourth. On the right of that area I would like to move the map.
Thanks
EDIT2:
Ok, now I figured out how to properly subclass SlidingPaneLayout, now the problem is how to capture correctly the touch event:
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN
&& event.getX() > (getWidth() / 6)) {
return false;
}
return super.onTouchEvent(event);
}
With this code I'm not able to slide the map, it remains fixed. the problem is that I want to intercept the touch ONLY when the right panel is selected (in other words, only when map is displayed).