A tab layout very similar to Google Play tab layout
PlayTabLayout
PlayTabLayout is a tab layout very similar to Google Play tab layout. The main feature is that ripple shows in a particular place where user taps.
The current minSDK version is API level 16.
Download
Gradle:
implementation 'com.github.armcha:PlayTabLayout:1.2.4'
Download sample apk
Setup and usage
- Add AutoLinkTextView to your layout
<io.armcha.playtablayout.core.PlayTabLayout
android:id="@+id/playTabLayout"
android:layout_width="match_parent"
android:layout_height="some_dp" />
- Add tab colors
playTabLayout.colors = intArrayOf(R.color.f,
R.color.s,
R.color.t,
R.color.four)
Note: array must be the same size as your adapter item count
- And you can use it like a regular tab layout
viewPager.adapter = TabAdapter(supportFragmentManager)
val tabLayout = playTabLayout.tabLayout
tabLayout.setupWithViewPager(viewPager)