Example usage for Java android.support.v4.view ViewPager fields, constructors, methods, implement or subclass
The text is from its open source code.
int | SCROLL_STATE_IDLE Indicates that the pager is in an idle, settled state. |
int | SCROLL_STATE_DRAGGING Indicates that the pager is currently being dragged by the user. |
int | SCROLL_STATE_SETTLING Indicates that the pager is in the process of settling to a final position. |
void | addView(View child) Adds a child view. |
void | addView(View child, int index) Adds a child view. |
boolean | arrowScroll(int direction) |
void | bringChildToFront(View child) |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
T | findViewById(@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. |
T | findViewWithTag(Object tag) Look for a child view with the given tag. |
PagerAdapter | getAdapter() Retrieve the current adapter supplying pages. |
View | getChildAt(int index) Returns the view at the specified position in the group. |
int | getChildCount() Returns the number of children in the group. |
Class> | getClass() Returns the runtime class of this Object . |
Context | getContext() Returns the context the view is running in, through which it can access the current theme, resources, etc. |
int | getCurrentItem() |
int | getHeight() Return the height of your view. |
int | getId() Returns this view's identifier. |
ViewGroup.LayoutParams | getLayoutParams() Get the LayoutParams associated with this view. |
void | getLocationOnScreen(@Size(2) int[] outLocation) Computes the coordinates of this view on the screen. |
int | getMeasuredHeight() Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMeasuredHeightAndState() Return the full height measurement information for this view as computed by the most recent call to #measure(int,int) . |
int | getMeasuredWidth() Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMeasuredWidthAndState() Return the full width measurement information for this view as computed by the most recent call to #measure(int,int) . |
ViewParent | getParent() Gets the parent of this view. |
Resources | getResources() Returns the resources associated with this view. |
Object | getTag(int key) Returns the tag associated with this view and the specified key. |
Object | getTag() Returns this view's tag. |
ViewTreeObserver | getViewTreeObserver() Returns the ViewTreeObserver for this view's hierarchy. |
int | getVisibility() Returns the visibility status for this view. |
int | getWidth() Return the width of your view. |
IBinder | getWindowToken() Retrieve a unique token identifying the window this view is attached to. |
void | invalidate() Invalidate the whole view. |
void | removeView(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. |
void | requestLayout() Call this when something has changed which has invalidated the layout of this view. |
void | setAdapter(PagerAdapter adapter) Set a PagerAdapter that will supply views for this pager as needed. |
void | setBackgroundColor(@ColorInt int color) Sets the background color for this view. |
void | setBackgroundDrawable(Drawable background) |
void | setClickable(boolean clickable) Enables or disables click events for this view. |
void | setClipChildren(boolean clipChildren) By default, children are clipped to their bounds before drawing. |
void | setClipToPadding(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. |
void | setCurrentItem(int item) Set the currently selected page. |
void | setCurrentItem(int item, boolean smoothScroll) Set the currently selected page. |
void | setId(@IdRes int id) Sets the identifier for this view. |
OnPageChangeListener | setInternalPageChangeListener(OnPageChangeListener listener) Set a separate OnPageChangeListener for internal use by the support library. |
void | setLayoutParams(ViewGroup.LayoutParams params) Set the layout parameters associated with this view. |
void | setOffscreenPageLimit(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. |
void | setOnAdapterChangeListener(OnAdapterChangeListener listener) |
void | setOnClickListener(@Nullable OnClickListener l) Register a callback to be invoked when this view is clicked. |
void | setOnPageChangeListener(OnPageChangeListener listener) Set a listener that will be invoked whenever the page changes or is incrementally scrolled. |
void | setOnTouchListener(OnTouchListener l) Register a callback to be invoked when a touch event is sent to this view. |
void | setOverScrollMode(int overScrollMode) Set the over-scroll mode for this view. |
void | setPadding(int left, int top, int right, int bottom) Sets the padding. |
void | setPageMargin(int marginPixels) Set the margin between pages. |
void | setPageMarginDrawable(Drawable d) Set a drawable that will be used to fill the margin between pages. |
void | setPageMarginDrawable(int resId) Set a drawable that will be used to fill the margin between pages. |
void | setTag(int key, final Object tag) Sets a tag associated with this view and a key. |
void | setTag(final Object tag) Sets the tag associated with this view. |
void | setVisibility(@Visibility int visibility) Set the visibility state of this view. |
void | startAnimation(Animation animation) Start the specified animation now. |