7

One way to implement swipe in Tabs of TabLayout is using viewpager. Using navigation architecture component for navigation it is not clear how to use viewpager. If we are not using viewpager, what is the recommended way to implement swipe left or right in tabs of TabLayout.

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212
explorer2050
  • 191
  • 7
  • may I know why not viewPager? – Akash Dubey Oct 31 '18 at 06:41
  • @Akash it is not clear how to use viewpager with Navigation library many people are searching for solution for this https://stackoverflow.com/questions/52540303/android-jetpack-navigation-with-viewpager-and-tablayout – explorer2050 Oct 31 '18 at 08:44
  • As ViewPager Fragments are not Top-Level-Destinations (in my case), I use ViewPager with a normal adapter, without any navigation component... – the_dani Oct 31 '18 at 08:56
  • @the_dani your's is an isolated case as you are not using navigation component. it will limit you to reuse fragment elsewhere in app. We need some right approach or solution with fragments being part of navigation component. – explorer2050 Nov 01 '18 at 05:04
  • linking another related question https://stackoverflow.com/questions/52630267/how-to-implement-a-viewpager-using-new-navigation-architecture-component?rq=1 – explorer2050 Nov 01 '18 at 05:11

0 Answers0