public class

TitlePageIndicator

extends View
implements PageIndicator
java.lang.Object
   ↳ android.view.View
     ↳ com.viewpagerindicator.TitlePageIndicator

Class Overview

A TitlePageIndicator is a PageIndicator which displays the title of left view (if exist), the title of the current select view (centered) and the title of the right view (if exist). When the user scrolls the ViewPager then titles are also scrolled.

Summary

Nested Classes
enum TitlePageIndicator.IndicatorStyle  
interface TitlePageIndicator.OnCenterItemClickListener Interface for a callback when the center item has been clicked. 
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
TitlePageIndicator(Context context)
TitlePageIndicator(Context context, AttributeSet attrs)
TitlePageIndicator(Context context, AttributeSet attrs, int defStyle)
Public Methods
float getClipPadding()
int getFooterColor()
float getFooterIndicatorHeight()
float getFooterIndicatorPadding()
TitlePageIndicator.IndicatorStyle getFooterIndicatorStyle()
float getFooterLineHeight()
int getSelectedColor()
int getTextColor()
float getTextSize()
float getTitlePadding()
float getTopPadding()
Typeface getTypeface()
boolean isSelectedBold()
void notifyDataSetChanged()
Notify the indicator that the fragment list has changed.
void onPageScrollStateChanged(int state)
void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
void onPageSelected(int position)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
boolean onTouchEvent(MotionEvent ev)
void setClipPadding(float clipPadding)
void setCurrentItem(int item)

Set the current page of both the ViewPager and indicator.

void setFooterColor(int footerColor)
void setFooterIndicatorHeight(float footerTriangleHeight)
void setFooterIndicatorPadding(float footerIndicatorPadding)
void setFooterIndicatorStyle(TitlePageIndicator.IndicatorStyle indicatorStyle)
void setFooterLineHeight(float footerLineHeight)
void setOnCenterItemClickListener(TitlePageIndicator.OnCenterItemClickListener listener)
Set a callback listener for the center item click.
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener)
Set a page change listener which will receive forwarded events.
void setSelectedBold(boolean selectedBold)
void setSelectedColor(int selectedColor)
void setTextColor(int textColor)
void setTextSize(float textSize)
void setTitlePadding(float titlePadding)
void setTopPadding(float topPadding)
void setTypeface(Typeface typeface)
void setViewPager(ViewPager view)
Bind the indicator to a ViewPager.
void setViewPager(ViewPager view, int initialPosition)
Bind the indicator to a ViewPager.
Protected Methods
void onDraw(Canvas canvas)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface com.viewpagerindicator.PageIndicator

Public Constructors

public TitlePageIndicator (Context context)

public TitlePageIndicator (Context context, AttributeSet attrs)

public TitlePageIndicator (Context context, AttributeSet attrs, int defStyle)

Public Methods

public float getClipPadding ()

public int getFooterColor ()

public float getFooterIndicatorHeight ()

public float getFooterIndicatorPadding ()

public TitlePageIndicator.IndicatorStyle getFooterIndicatorStyle ()

public float getFooterLineHeight ()

public int getSelectedColor ()

public int getTextColor ()

public float getTextSize ()

public float getTitlePadding ()

public float getTopPadding ()

public Typeface getTypeface ()

public boolean isSelectedBold ()

public void notifyDataSetChanged ()

Notify the indicator that the fragment list has changed.

public void onPageScrollStateChanged (int state)

public void onPageScrolled (int position, float positionOffset, int positionOffsetPixels)

public void onPageSelected (int position)

public void onRestoreInstanceState (Parcelable state)

public Parcelable onSaveInstanceState ()

public boolean onTouchEvent (MotionEvent ev)

public void setClipPadding (float clipPadding)

public void setCurrentItem (int item)

Set the current page of both the ViewPager and indicator.

This must be used if you need to set the page before the views are drawn on screen (e.g., default start page).

public void setFooterColor (int footerColor)

public void setFooterIndicatorHeight (float footerTriangleHeight)

public void setFooterIndicatorPadding (float footerIndicatorPadding)

public void setFooterIndicatorStyle (TitlePageIndicator.IndicatorStyle indicatorStyle)

public void setFooterLineHeight (float footerLineHeight)

public void setOnCenterItemClickListener (TitlePageIndicator.OnCenterItemClickListener listener)

Set a callback listener for the center item click.

Parameters
listener Callback instance.

public void setOnPageChangeListener (ViewPager.OnPageChangeListener listener)

Set a page change listener which will receive forwarded events.

public void setSelectedBold (boolean selectedBold)

public void setSelectedColor (int selectedColor)

public void setTextColor (int textColor)

public void setTextSize (float textSize)

public void setTitlePadding (float titlePadding)

public void setTopPadding (float topPadding)

public void setTypeface (Typeface typeface)

public void setViewPager (ViewPager view)

Bind the indicator to a ViewPager.

public void setViewPager (ViewPager view, int initialPosition)

Bind the indicator to a ViewPager.

Protected Methods

protected void onDraw (Canvas canvas)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)