Reputation: 181
I am new to android development and I want to implement a sliding effect on the tab host when the user slides left or right to change tabs implemented using fragments and view pager.
As soon as the user slides the page, the tab host indicator should also slide.
Facebook's new android app has this already implemented. Please refer to this image for a better understanding as to what I mean.
Sample Image
Thanks for any help available :)
Upvotes: 0
Views: 6655
Reputation: 3186
It's possible to use ActionBar tabs, but this design mode has been deprecated in API 21, and it works differently on different sized screens anyway which can lead to some undesired effects.
I used the classes in SlidingTabs example from Android developers to achieve this effect without having to include a 3rd party library dependency. There is a video tutorial as well.
Upvotes: 1
Reputation: 16590
Use a ViewPager with ActionBar tabs.
See here, http://developer.android.com/training/implementing-navigation/lateral.html
Upvotes: 0