You're looking for Google's SlidingTabLayout
. And SeriesGuide is open source, but uses PagerSlidingTabStrip.
To use Google's SlidingTabLayout
, you'll need to copy over two classes into your project. The classes you need are:
An example layout implementing the SlidingTabLayout
would looks this like:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<your_path_to.SlidingTabLayout
android:id="@+id/slidingTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
After inflating the layout and initializing the SlidingTabLayout
using View.findViewById
, you call SlidingTabLayout.setViewPager
to bind the ViewPager
to the tabs.