Android 12 Developer Preview is here! Try it out, and give us your feedback!


open class PagerTabStrip : PagerTitleStrip
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.viewpager.widget.PagerTitleStrip
   ↳ androidx.viewpager.widget.PagerTabStrip

PagerTabStrip is an interactive indicator of the current, next, and previous pages of a ViewPager. It is intended to be used as a child view of a ViewPager widget in your XML layout. Add it as a child of a ViewPager in your layout file and set its android:layout_gravity to TOP or BOTTOM to pin it to the top or bottom of the ViewPager. The title from each page is supplied by the method PagerAdapter#getPageTitle(int) in the adapter supplied to the ViewPager.

For a non-interactive indicator, see PagerTitleStrip.


Public constructors
<init>(@NonNull context: Context)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Public methods
open Boolean

Return whether or not this tab strip will draw a full-width underline.

open Int

open Boolean

open Unit
setBackgroundColor(@ColorInt color: Int)

open Unit

open Unit
setBackgroundResource(@DrawableRes resId: Int)

open Unit

Set whether this tab strip should draw a full-width underline in the current tab indicator color.

open Unit
setPadding(left: Int, top: Int, right: Int, bottom: Int)

open Unit
setTabIndicatorColor(@ColorInt color: Int)

Set the color of the tab indicator bar.

open Unit

Set the color of the tab indicator bar from a color resource.

open Unit
setTextSpacing(textSpacing: Int)

Protected methods
open Unit
onDraw(canvas: Canvas!)

Inherited functions