public class LockableViewPager
extends ViewPager
| Modifier and Type | Class and Description |
|---|---|
static class |
LockableViewPager.LockMode
The ways in which a
LockableViewPager can be locked. |
| Constructor and Description |
|---|
LockableViewPager(android.content.Context context)
Constructs a new LockableViewPager instance.
|
LockableViewPager(android.content.Context context,
android.util.AttributeSet attrs)
Constructs a new LockableViewPager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fakeDragBy(float xOffset) |
LockableViewPager.LockMode |
getLockMode() |
boolean |
onInterceptTouchEvent(android.view.MotionEvent ev) |
boolean |
onTouchEvent(android.view.MotionEvent ev) |
void |
setCurrentItem(int item) |
void |
setCurrentItem(int item,
boolean smoothScroll)
Set the currently selected page.
|
void |
setLockMode(LockableViewPager.LockMode lockMode)
Sets the lock mode.
|
public LockableViewPager(android.content.Context context)
context - the Context in which this LockableViewPager is operatingpublic LockableViewPager(android.content.Context context,
android.util.AttributeSet attrs)
context - the Context in which this LockableViewPager is operatingattrs - an attribute in the current theme that contains a reference to a style resource that
supplies defaults values for the StyledAttributes, or 0 to not look for defaultspublic void setLockMode(LockableViewPager.LockMode lockMode)
lockMode - the lock mode to use, not nullpublic LockableViewPager.LockMode getLockMode()
public boolean onInterceptTouchEvent(android.view.MotionEvent ev)
public boolean onTouchEvent(android.view.MotionEvent ev)
public void fakeDragBy(float xOffset)
public void setCurrentItem(int item)
public void setCurrentItem(int item,
boolean smoothScroll)
item - Item index to selectsmoothScroll - True to smoothly scroll to the new item, false to transition immediately