0

I am trying to implement swipe tabs in my application but don't know what is the best way to do it.I am confused as to whether I should action bar navigation bars or some other mechanism. I want my application to have Scroll-able views like in the link below?

https://play.google.com/store/apps/details?id=com.asus.todolist

afnan1992
  • 57
  • 10

1 Answers1

0

You can use uiautomatorviewer to determine what that app is using. My guess is that it is using a ViewPager with a PagerTabStrip for the tabs.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • You can easily add tabs dynamically with ViewPager? – afnan1992 Mar 10 '14 at 17:27
  • @afnan1992: That depends upon your implementation of `PagerAdapter` that you use. The stock `FragmentPagerAdapter` and `FragmentStatePagerAdapter` are IMHO not well suited to changing the mix of tabs dynamically. My `ArrayPagerAdapter` handles them well: https://github.com/commonsguy/cwac-pager – CommonsWare Mar 10 '14 at 17:51
  • This also is a suitable solution to my problem? http://stackoverflow.com/questions/10114417/insert-and-remove-fragments-into-viewpager-properly?lq=1 – afnan1992 Mar 10 '14 at 18:02
  • @afnan1992: None of those would seem to be relevant, but perhaps I am not understanding your problem. – CommonsWare Mar 10 '14 at 18:36
  • I want to add new fragment(tab) to the PageAdapter when some event gets triggered? I do believe the link I have given solves the current predicament. – afnan1992 Mar 10 '14 at 18:42
  • You don't think I can achieve it with link I have given? – afnan1992 Mar 10 '14 at 18:58