As the title states, I have a GoogleMap control (API v2) inside of a fragment that is itself an item in a ViewPager. When I drag on the map, if my first drag motion is on the horizontal axis, the ViewPager gets all of the drag events. If I make my first drag motion on the vertical plane, then all subsequent drags are delegated to the map control. I would like to have the GoogleMap capture all drag events. I added some debugging and I see that when I tap on the map control and when I begin dragging on the vertical plane, no onTouch events even make it to the ViewPager, so it seems that the GoogleMap gets the first chance to handle the event or pass it down. I can’t find any methods or listeners on the GoogleMap class to tell it to handle all touch/move/drag events.
Share
The solution was to create a custom ViewPager with an override of the canScroll method and use that in my xml. The canScroll method is passed a tree of child views recursively and then decides if the View is allowed to handle the horizontal scrolling or if it should be captured by the parent ViewPager
and in your layout…