PagerTitleStrip
@ViewPager.DecorView
class PagerTitleStrip : ViewGroup
PagerTabStrip |
PagerTabStrip is an interactive indicator of the current, next, and previous pages of a |
PagerTitleStrip is a non-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 an interactive indicator, see PagerTabStrip.
Summary
Public constructors |
|---|
PagerTitleStrip(context: Context) |
PagerTitleStrip(context: Context, attrs: AttributeSet?) |
Public functions |
|
|---|---|
Int |
|
Unit |
|
Unit |
setGravity(gravity: Int)Set the |
Unit |
setNonPrimaryAlpha(alpha: @FloatRange(from = 0.0, to = 1.0) Float)Set the alpha value used for non-primary page titles. |
Unit |
setTextColor(color: @ColorInt Int)Set the color value used as the base color for all displayed page titles. |
Unit |
setTextSize(unit: Int, size: Float)Set the default text size to a given unit and value. |
Unit |
setTextSpacing(spacingPixels: Int)Set the required spacing between title segments. |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public functions
getTextSpacing
fun getTextSpacing(): Int
| Returns | |
|---|---|
Int |
The required spacing between title segments in pixels |
setGravity
fun setGravity(gravity: Int): Unit
Set the Gravity used to position text within the title strip. Only the vertical gravity component is used.
setNonPrimaryAlpha
fun setNonPrimaryAlpha(alpha: @FloatRange(from = 0.0, to = 1.0) Float): Unit
Set the alpha value used for non-primary page titles.
| Parameters | |
|---|---|
alpha: @FloatRange(from = 0.0, to = 1.0) Float |
Opacity value in the range 0-1f |
setTextColor
fun setTextColor(color: @ColorInt Int): Unit
Set the color value used as the base color for all displayed page titles. Alpha will be ignored for non-primary page titles. See setNonPrimaryAlpha.
setTextSize
fun setTextSize(unit: Int, size: Float): Unit
Set the default text size to a given unit and value. See TypedValue for the possible dimension units.
Example: to set the text size to 14px, use setTextSize(TypedValue.COMPLEX_UNIT_PX, 14);
setTextSpacing
fun setTextSpacing(spacingPixels: Int): Unit
Set the required spacing between title segments.
| Parameters | |
|---|---|
spacingPixels: Int |
Spacing between each title displayed in pixels |