0

I'm developing a small android mobile application with a tab based interface. One tab shows a Map and another tab will show search functionality.

I'm running into an annoying problem with the map, where if I pan left (swipe) on the map, it will go to the right tab, instead of actually panning the map.

I still want the tabs on the top to work the way they do, while disabling the 'swipe' from one tab contents to another.

Here is my main activity that hosts the tabs:

http://msse-idroid-mobile.googlecode.com/svn/trunk/FinalProject/src/com/idroid/activities/FragmentTabsActivity.java

Here are the fragments populating the tabs:

http://msse-idroid-mobile.googlecode.com/svn/trunk/FinalProject/src/com/idroid/fragments/

Any ideas?

mainstringargs
  • 13,563
  • 35
  • 109
  • 174

2 Answers2

0

Do it like Endomondo does it.

Add a button on top of your map that enable/disable the panning on the map, to disable the map panning just do setClickable(false);.

This way you get both things. Panning and swipping.

rui.araujo
  • 9,597
  • 1
  • 18
  • 24
0

I ended up rolling my own solution by overriding functionality in the ViewPager class. See here:

http://msse-idroid-mobile.googlecode.com/svn/trunk/FinalProject/src/com/idroid/view/MyViewPager.java

mainstringargs
  • 13,563
  • 35
  • 109
  • 174