public abstract class ViewPagerLayoutManager
extends RecyclerView.LayoutManager
| Modifier and Type | Class and Description |
|---|---|
static interface |
ViewPagerLayoutManager.OnPageChangeListener |
| Modifier and Type | Field and Description |
|---|---|
protected float |
interval |
protected int |
mDecoratedChildHeight |
protected int |
mDecoratedChildWidth |
protected float |
offset |
protected int |
startLeft |
protected int |
startTop |
| Constructor and Description |
|---|
ViewPagerLayoutManager() |
ViewPagerLayoutManager(boolean shouldReverseLayout) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calItemLeftPosition(float targetOffset) |
protected int |
calItemTopPosition(float targetOffset) |
boolean |
canScrollHorizontally() |
int |
computeHorizontalScrollExtent(RecyclerView.State state) |
int |
computeHorizontalScrollOffset(RecyclerView.State state) |
int |
computeHorizontalScrollRange(RecyclerView.State state) |
android.graphics.PointF |
computeScrollVectorForPosition(int targetPosition) |
android.view.View |
findViewByPosition(int position) |
RecyclerView.LayoutParams |
generateDefaultLayoutParams() |
int |
getCurrentPosition() |
protected float |
getDistanceRatio() |
protected int |
getHorizontalSpace() |
int |
getOffsetCenterView() |
boolean |
getStackFromEnd() |
protected int |
getVerticalSpace() |
boolean |
isSmoothScrollbarEnabled()
Returns the current state of the smooth scrollbar feature.
|
protected float |
maxRemoveOffset() |
protected float |
minRemoveOffset() |
void |
onAdapterChanged(RecyclerView.Adapter oldAdapter,
RecyclerView.Adapter newAdapter) |
void |
onLayoutChildren(RecyclerView.Recycler recycler,
RecyclerView.State state) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
protected float |
propertyChangeWhenScroll(android.view.View itemView) |
int |
scrollHorizontallyBy(int dx,
RecyclerView.Recycler recycler,
RecyclerView.State state) |
void |
scrollToPosition(int position) |
void |
setEnableEndlessScroll(boolean enable) |
protected abstract float |
setInterval() |
protected abstract void |
setItemViewProperty(android.view.View itemView,
float targetOffset) |
void |
setOnPageChangeListener(ViewPagerLayoutManager.OnPageChangeListener onPageChangeListener) |
void |
setSmoothScrollbarEnabled(boolean enabled)
When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed
based on the number of visible pixels in the visible items.
|
void |
setStackFromEnd(boolean stackFromEnd) |
protected abstract void |
setUp()
You can set up your own properties here or change the exist properties like startLeft and startTop
|
void |
smoothScrollToPosition(RecyclerView recyclerView,
RecyclerView.State state,
int position) |
protected int mDecoratedChildWidth
protected int mDecoratedChildHeight
protected int startLeft
protected int startTop
protected float offset
protected float interval
public ViewPagerLayoutManager()
public ViewPagerLayoutManager(boolean shouldReverseLayout)
protected abstract float setInterval()
protected abstract void setUp()
protected abstract void setItemViewProperty(android.view.View itemView,
float targetOffset)
public void onLayoutChildren(RecyclerView.Recycler recycler,
RecyclerView.State state)
public android.view.View findViewByPosition(int position)
public boolean canScrollHorizontally()
public void onAdapterChanged(RecyclerView.Adapter oldAdapter,
RecyclerView.Adapter newAdapter)
public android.os.Parcelable onSaveInstanceState()
public void onRestoreInstanceState(android.os.Parcelable state)
public RecyclerView.LayoutParams generateDefaultLayoutParams()
public void scrollToPosition(int position)
public void smoothScrollToPosition(RecyclerView recyclerView,
RecyclerView.State state,
int position)
public android.graphics.PointF computeScrollVectorForPosition(int targetPosition)
public int computeHorizontalScrollOffset(RecyclerView.State state)
public int computeHorizontalScrollExtent(RecyclerView.State state)
public int computeHorizontalScrollRange(RecyclerView.State state)
public int scrollHorizontallyBy(int dx,
RecyclerView.Recycler recycler,
RecyclerView.State state)
protected int calItemLeftPosition(float targetOffset)
protected int calItemTopPosition(float targetOffset)
protected int getHorizontalSpace()
protected int getVerticalSpace()
protected float maxRemoveOffset()
protected float minRemoveOffset()
protected float propertyChangeWhenScroll(android.view.View itemView)
protected float getDistanceRatio()
public int getCurrentPosition()
public int getOffsetCenterView()
public void setOnPageChangeListener(ViewPagerLayoutManager.OnPageChangeListener onPageChangeListener)
public void setEnableEndlessScroll(boolean enable)
public void setSmoothScrollbarEnabled(boolean enabled)
When smooth scrollbar is disabled, the position and size of the scrollbar thumb is based solely on the number of items in the adapter and the position of the visible items inside the adapter. This provides a stable scrollbar as the user navigates through a list of items with varying widths / heights.
enabled - Whether or not to enable smooth scrollbar.setSmoothScrollbarEnabled(boolean)public void setStackFromEnd(boolean stackFromEnd)
public boolean getStackFromEnd()
public boolean isSmoothScrollbarEnabled()
setSmoothScrollbarEnabled(boolean)