|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectViewGroup
android.support.v4.view.PagerTitleStrip
public class PagerTitleStrip
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
PagerAdapter.getPageTitle(int)
in the adapter supplied to
the ViewPager.
For an interactive indicator, see PagerTabStrip
.
Constructor Summary | |
---|---|
PagerTitleStrip(Context context)
|
|
PagerTitleStrip(Context context,
AttributeSet attrs)
|
Method Summary | |
---|---|
int |
getTextSpacing()
|
protected void |
onAttachedToWindow()
|
protected void |
onDetachedFromWindow()
|
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b)
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
|
void |
requestLayout()
|
void |
setGravity(int gravity)
Set the Gravity used to position text within the title strip. |
void |
setNonPrimaryAlpha(float alpha)
Set the alpha value used for non-primary page titles. |
void |
setTextColor(int color)
Set the color value used as the base color for all displayed page titles. |
void |
setTextSize(int unit,
float size)
Set the default text size to a given unit and value. |
void |
setTextSpacing(int spacingPixels)
Set the required spacing between title segments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PagerTitleStrip(Context context)
public PagerTitleStrip(Context context, AttributeSet attrs)
Method Detail |
---|
public void setTextSpacing(int spacingPixels)
spacingPixels
- Spacing between each title displayed in pixelspublic int getTextSpacing()
public void setNonPrimaryAlpha(float alpha)
alpha
- Opacity value in the range 0-1fpublic void setTextColor(int color)
setNonPrimaryAlpha(float)
.
color
- Color hex code in 0xAARRGGBB formatpublic void setTextSize(int unit, float size)
TypedValue
for the possible dimension units.
Example: to set the text size to 14px, use setTextSize(TypedValue.COMPLEX_UNIT_PX, 14);
unit
- The desired dimension unitsize
- The desired size in the given unitspublic void setGravity(int gravity)
Gravity
used to position text within the title strip.
Only the vertical gravity component is used.
gravity
- Gravity
constant for positioning title textprotected void onAttachedToWindow()
protected void onDetachedFromWindow()
public void requestLayout()
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
protected void onLayout(boolean changed, int l, int t, int r, int b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |