public class

PagerTabStripV22

extends PagerTitleStripV22
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.v4.view.PagerTitleStripV22
         ↳ android.support.v4.view.PagerTabStripV22

Class Overview

PagerTabStrip is an interactive indicator of the current, next, and previous pages of a android.support.v4.view.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 android.support.v4.view.PagerAdapter#getPageTitle(int) in the adapter supplied to the ViewPager.

For a non-interactive indicator, see PagerTitleStripV22.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PagerTabStripV22(Context context)
PagerTabStripV22(Context context, AttributeSet attrs)
Public Methods
boolean getDrawFullUnderline()
Return whether or not this tab strip will draw a full-width underline.
int getTabIndicatorColor()
boolean onTouchEvent(MotionEvent ev)
void setBackgroundColor(int color)
void setBackgroundDrawable(Drawable d)
void setBackgroundResource(int resId)
void setDrawFullUnderline(boolean drawFull)
Set whether this tab strip should draw a full-width underline in the current tab indicator color.
void setPadding(int left, int top, int right, int bottom)
void setTabIndicatorColor(int color)
Set the color of the tab indicator bar.
void setTabIndicatorColorResource(int resId)
Set the color of the tab indicator bar from a color resource.
void setTextSpacing(int textSpacing)
Set the required spacing between title segments.
Protected Methods
void onDraw(Canvas canvas)
[Expand]
Inherited Methods
From class android.support.v4.view.PagerTitleStripV22
From class android.view.ViewGroup
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.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public PagerTabStripV22 (Context context)

public PagerTabStripV22 (Context context, AttributeSet attrs)

Public Methods

public boolean getDrawFullUnderline ()

Return whether or not this tab strip will draw a full-width underline. This defaults to true if no background is set.

Returns
  • true if this tab strip will draw a full-width underline in the current tab indicator color.

public int getTabIndicatorColor ()

Returns
  • The current tab indicator color as an 0xRRGGBB value.

public boolean onTouchEvent (MotionEvent ev)

public void setBackgroundColor (int color)

public void setBackgroundDrawable (Drawable d)

public void setBackgroundResource (int resId)

public void setDrawFullUnderline (boolean drawFull)

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

Parameters
drawFull true to draw a full-width underline, false otherwise

public void setPadding (int left, int top, int right, int bottom)

public void setTabIndicatorColor (int color)

Set the color of the tab indicator bar.

Parameters
color Color to set as an 0xRRGGBB value. The high byte (alpha) is ignored.

public void setTabIndicatorColorResource (int resId)

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

Parameters
resId Resource ID of a color resource to load

public void setTextSpacing (int textSpacing)

Set the required spacing between title segments.

Parameters
textSpacing Spacing between each title displayed in pixels

Protected Methods

protected void onDraw (Canvas canvas)