I'm developing an android app that has a page with a tablayout including 2 tabs, a list page and a map (both are fragments). The list elements are viewpagers holding images, but when the user reaches the last image in the viewpager, the tablayout gets the next swipe event and it switches to the map. This also happens if the user tries to swipe the images starting at the very right side of the screen.
I'd like to switch of the swipe functionality between the tabs completely, but didn't find a way to do it so.
This is how I setup my tabs:
ViewPager fragmentPager = (ViewPager) findViewById(R.id.viewpager);
fragmentPager.setAdapter(new MyPagerAdapter);//extends FragmentPagerAdapter
TabLayout tabLayout = (TabLayout) findViewById(R.id.tablayout);
tabLayout.setupWithViewPager(fragmentPager);