public class GravityPagerSnapHelper
extends PagerSnapHelper
| Constructor and Description |
|---|
GravityPagerSnapHelper(int gravity) |
GravityPagerSnapHelper(int gravity,
boolean enableSnapLastItem) |
GravityPagerSnapHelper(int gravity,
boolean enableSnapLastItem,
GravitySnapHelper.SnapListener snapListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachToRecyclerView(RecyclerView recyclerView) |
int[] |
calculateDistanceToFinalSnap(RecyclerView.LayoutManager layoutManager,
android.view.View targetView) |
void |
enableLastItemSnap(boolean snap)
Enable snapping of the last item that's snappable.
|
android.view.View |
findSnapView(RecyclerView.LayoutManager layoutManager) |
int |
getCurrentSnappedPosition() |
void |
scrollToPosition(int position) |
void |
smoothScrollToPosition(int position) |
public GravityPagerSnapHelper(int gravity)
public GravityPagerSnapHelper(int gravity,
boolean enableSnapLastItem)
public GravityPagerSnapHelper(int gravity,
boolean enableSnapLastItem,
GravitySnapHelper.SnapListener snapListener)
public void attachToRecyclerView(RecyclerView recyclerView)
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic int[] calculateDistanceToFinalSnap(RecyclerView.LayoutManager layoutManager,
android.view.View targetView)
public android.view.View findSnapView(RecyclerView.LayoutManager layoutManager)
public void enableLastItemSnap(boolean snap)
snap - true if you want to enable snapping of the last snappable itempublic void smoothScrollToPosition(int position)
public void scrollToPosition(int position)
public int getCurrentSnappedPosition()