Question

I would like to achieve a navigation in my app like Pinterest or Trello, that is, kind of three tabs to navigation + horizontal scrolling. I have made a custom tabbar for this (since I couldn't guess how to change tabs width in my actionbar with navigation TAB mode). So I have three buttons to navigate from one fragment to another. Now I would like to implement the horizontal scrolling like these two examples, to also navigate among my fragments. I have read about View Pager but I don't know if it fits to my case, since I don't have only views but fragments. Does anybody have an example or an idea of how to do it? Could I apply it among different activities? Thanks

Was it helpful?

Solution

Please take a look at the duplicate question that I just answered:

How to implement a swipe-gesture between Fragments?

I suppose the Android ViewPager is what you are looking for:

http://developer.android.com/reference/android/support/v4/view/ViewPager.html

Here is a nice tutorial on how to implement it:

http://developer.android.com/training/animation/screen-slide.html

The basic idea is that you have multiple Fragments, each representing a different Screen. The ViewPager enables the user to swipe between the different Fragments and display different content.

OTHER TIPS

You can use ViewPager. More information about viewpager this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top