The Android developer site shows an example in Providing Descendant and Lateral Navigation Figure 7 (Labels/third one down in the image) which I'd like to use in my app. I can't find any reference to how to make this effect. The closest I found was a post in reference to the second item (tick marks) here. Is this supported in Android or is there a library I could use?
-
I think you need [this](http://naeemgik.blogspot.com/2013/09/android-custom-scrollable-tabs.html) – naeemgik Aug 23 '17 at 03:53
1 Answers
You should look into ViewPager with FragmentPagerAdapter. Here is an example showing how to do so.
Here is another example from the android developer site
In case these links die in the future here is the main part from the developer site:
You can create swipe views in your app using the ViewPager widget, available in the Support Library. The ViewPager is a layout widget in which each child view is a separate page (a separate tab) in the layout.
To set up your layout with ViewPager, add a element to your XML layout. For example, if each page in the swipe view should consume the entire layout, then your layout looks like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
To insert child views that represent each page, you need to hook this layout to a PagerAdapter. There are two kinds of adapter you can use:
FragmentPagerAdapter
This is best when navigating between sibling screens representing a fixed, small number of pages.
FragmentStatePagerAdapter
This is best for paging across a collection of objects for which the number of pages is undetermined. It destroys fragments as the user navigates to other pages, minimizing memory usage.

- 8,137
- 6
- 28
- 46