Java android.support.v4.view ViewPager fields, constructors, methods, implement or subclass

Example usage for Java android.support.v4.view ViewPager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.support.v4.view ViewPager.

The text is from its open source code.

Subclass

android.support.v4.view.ViewPager has subclasses.
Click this link to see all its subclasses.

Field

intSCROLL_STATE_IDLE
Indicates that the pager is in an idle, settled state.
intSCROLL_STATE_DRAGGING
Indicates that the pager is currently being dragged by the user.
intSCROLL_STATE_SETTLING
Indicates that the pager is in the process of settling to a final position.

Constructor

Method

voidaddView(View child)

Adds a child view.

voidaddView(View child, int index)
Adds a child view.
booleanarrowScroll(int direction)
voidbringChildToFront(View child)
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
TfindViewById(@IdRes int id)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.
TfindViewWithTag(Object tag)
Look for a child view with the given tag.
PagerAdaptergetAdapter()
Retrieve the current adapter supplying pages.
ViewgetChildAt(int index)
Returns the view at the specified position in the group.
intgetChildCount()
Returns the number of children in the group.
ClassgetClass()
Returns the runtime class of this Object .
ContextgetContext()
Returns the context the view is running in, through which it can access the current theme, resources, etc.
intgetCurrentItem()
intgetHeight()
Return the height of your view.
intgetId()
Returns this view's identifier.
ViewGroup.LayoutParamsgetLayoutParams()
Get the LayoutParams associated with this view.
voidgetLocationOnScreen(@Size(2) int[] outLocation)

Computes the coordinates of this view on the screen.

intgetMeasuredHeight()
Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ).
intgetMeasuredHeightAndState()
Return the full height measurement information for this view as computed by the most recent call to #measure(int,int) .
intgetMeasuredWidth()
Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ).
intgetMeasuredWidthAndState()
Return the full width measurement information for this view as computed by the most recent call to #measure(int,int) .
ViewParentgetParent()
Gets the parent of this view.
ResourcesgetResources()
Returns the resources associated with this view.
ObjectgetTag(int key)
Returns the tag associated with this view and the specified key.
ObjectgetTag()
Returns this view's tag.
ViewTreeObservergetViewTreeObserver()
Returns the ViewTreeObserver for this view's hierarchy.
intgetVisibility()
Returns the visibility status for this view.
intgetWidth()
Return the width of your view.
IBindergetWindowToken()
Retrieve a unique token identifying the window this view is attached to.
voidinvalidate()
Invalidate the whole view.
voidremoveView(View view)

Note: do not invoke this method from #draw(android.graphics.Canvas) , #onDraw(android.graphics.Canvas) , #dispatchDraw(android.graphics.Canvas) or any related method.

voidrequestLayout()
Call this when something has changed which has invalidated the layout of this view.
voidsetAdapter(PagerAdapter adapter)
Set a PagerAdapter that will supply views for this pager as needed.
voidsetBackgroundColor(@ColorInt int color)
Sets the background color for this view.
voidsetBackgroundDrawable(Drawable background)
voidsetClickable(boolean clickable)
Enables or disables click events for this view.
voidsetClipChildren(boolean clipChildren)
By default, children are clipped to their bounds before drawing.
voidsetClipToPadding(boolean clipToPadding)
Sets whether this ViewGroup will clip its children to its padding and resize (but not clip) any EdgeEffect to the padded region, if padding is present.
voidsetCurrentItem(int item)
Set the currently selected page.
voidsetCurrentItem(int item, boolean smoothScroll)
Set the currently selected page.
voidsetId(@IdRes int id)
Sets the identifier for this view.
OnPageChangeListenersetInternalPageChangeListener(OnPageChangeListener listener)
Set a separate OnPageChangeListener for internal use by the support library.
voidsetLayoutParams(ViewGroup.LayoutParams params)
Set the layout parameters associated with this view.
voidsetOffscreenPageLimit(int limit)
Set the number of pages that should be retained to either side of the current page in the view hierarchy in an idle state.
voidsetOnAdapterChangeListener(OnAdapterChangeListener listener)
voidsetOnClickListener(@Nullable OnClickListener l)
Register a callback to be invoked when this view is clicked.
voidsetOnPageChangeListener(OnPageChangeListener listener)
Set a listener that will be invoked whenever the page changes or is incrementally scrolled.
voidsetOnTouchListener(OnTouchListener l)
Register a callback to be invoked when a touch event is sent to this view.
voidsetOverScrollMode(int overScrollMode)
Set the over-scroll mode for this view.
voidsetPadding(int left, int top, int right, int bottom)
Sets the padding.
voidsetPageMargin(int marginPixels)
Set the margin between pages.
voidsetPageMarginDrawable(Drawable d)
Set a drawable that will be used to fill the margin between pages.
voidsetPageMarginDrawable(int resId)
Set a drawable that will be used to fill the margin between pages.
voidsetTag(int key, final Object tag)
Sets a tag associated with this view and a key.
voidsetTag(final Object tag)
Sets the tag associated with this view.
voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.
voidstartAnimation(Animation animation)
Start the specified animation now.