PagerTabStrip
class PagerTabStrip : PagerTitleStrip
| kotlin.Any | ||||
| ↳ | 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 getPageTitle in the adapter supplied to the ViewPager.
For a non-interactive indicator, see PagerTitleStrip.
Summary
Public constructors |
|---|
PagerTabStrip(context: Context) |
PagerTabStrip(context: Context, attrs: AttributeSet?) |
Public functions |
|
|---|---|
Boolean |
Return whether or not this tab strip will draw a full-width underline. |
@ColorInt Int |
|
Boolean |
onTouchEvent(ev: MotionEvent!) |
Unit |
setBackgroundColor(color: @ColorInt Int) |
Unit |
This function is deprecated. |
Unit |
setBackgroundResource(resId: @DrawableRes Int) |
Unit |
setDrawFullUnderline(drawFull: Boolean)Set whether this tab strip should draw a full-width underline in the current tab indicator color. |
Unit |
setPadding(left: Int, top: Int, right: Int, bottom: Int) |
Unit |
setTabIndicatorColor(color: @ColorInt Int)Set the color of the tab indicator bar. |
Unit |
setTabIndicatorColorResource(resId: @ColorRes Int)Set the color of the tab indicator bar from a color resource. |
Unit |
setTextSpacing(spacingPixels: Int)Set the required spacing between title segments. |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public functions
getDrawFullUnderline
fun getDrawFullUnderline(): Boolean
Return whether or not this tab strip will draw a full-width underline. This defaults to true if no background is set.
| Returns | |
|---|---|
Boolean |
true if this tab strip will draw a full-width underline in the current tab indicator color. |
setDrawFullUnderline
fun setDrawFullUnderline(drawFull: Boolean): Unit
Set whether this tab strip should draw a full-width underline in the current tab indicator color.
| Parameters | |
|---|---|
drawFull: Boolean |
true to draw a full-width underline, false otherwise |
setTabIndicatorColor
fun setTabIndicatorColor(color: @ColorInt Int): Unit
Set the color of the tab indicator bar.
setTabIndicatorColorResource
fun setTabIndicatorColorResource(resId: @ColorRes Int): Unit
Set the color of the tab indicator bar from a color resource.
setTextSpacing
fun setTextSpacing(spacingPixels: Int): Unit
Set the required spacing between title segments.
| Parameters | |
|---|---|
spacingPixels: Int |
Spacing between each title displayed in pixels |