public class SlideLayoutManager extends SlideLayoutManagerBase
RecyclerView.LayoutManager
implementation that lays out items in a way
which resembles an image gallery where one item is shown in front as current and user can swipe
to move to an adjacent item.Modifier and Type | Class and Description |
---|---|
static class |
SlideLayoutManager.Transition |
RecyclerView.LayoutManager.Properties
Modifier and Type | Field and Description |
---|---|
static int |
HORIZONTAL |
static int |
VERTICAL |
Constructor and Description |
---|
SlideLayoutManager(Context context)
Creates an instance of the
SlideLayoutManager class. |
SlideLayoutManager(Context context,
int orientation)
Creates an instance of the
SlideLayoutManager class. |
Modifier and Type | Method and Description |
---|---|
int |
getItemSpacing()
Gets the current item spacing in pixels between the items.
|
int |
getNextItemPreview()
Gets a value indicating how many pixels from the next item should be visible without swiping.
|
int |
getPreviousItemPreview()
Gets a value indicating how many pixels from the previous item should be visible without swiping.
|
SlideLayoutManager.Transition |
getTransitionMode()
Gets the current transition mode seen when the current item changes.
|
boolean |
isScrollOnTap()
Indicates whether the adjacent items should become current when tapped.
|
void |
setItemSpacing(int itemSpacing)
Sets a value indicating how many pixels should be drawn between two items.
|
void |
setNextItemPreview(int nextItemPreview)
Sets a new value indicating how many pixels from the next item should be visible without swiping.
|
void |
setPreviousItemPreview(int previousItemPreview)
Sets a new value indicating how many pixels from the previous item should be visible without swiping.
|
void |
setScrollOnTap(boolean scrollOnTap)
Sets a value indicating whether the adjacent items should become current when tapped.
|
void |
setTransitionMode(SlideLayoutManager.Transition transitionMode)
Sets a new value for the transition mode seen when the current item changes.
|
addListener, canScrollHorizontally, canScrollVertically, generateDefaultLayoutParams, getCurrentPosition, isScrollEnabled, onAdapterChanged, onItemsAdded, onItemsChanged, onItemsMoved, onItemsRemoved, onItemsUpdated, onLayoutChildren, onScrollStateChanged, removeListener, scrollHorizontallyBy, scrollToNext, scrollToPosition, scrollToPrevious, scrollVerticallyBy, setCurrentPosition, setScrollEnabled, supportsPredictiveItemAnimations
addDisappearingView, addDisappearingView, addView, addView, assertInLayoutOrScroll, assertNotInLayoutOrScroll, attachView, attachView, attachView, calculateItemDecorationsForChild, checkLayoutParams, chooseSize, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, detachAndScrapAttachedViews, detachAndScrapView, detachAndScrapViewAt, detachView, detachViewAt, endAnimation, findContainingItemView, findViewByPosition, generateLayoutParams, generateLayoutParams, getBaseline, getBottomDecorationHeight, getChildAt, getChildCount, getChildMeasureSpec, getChildMeasureSpec, getClipToPadding, getColumnCountForAccessibility, getDecoratedBottom, getDecoratedLeft, getDecoratedMeasuredHeight, getDecoratedMeasuredWidth, getDecoratedRight, getDecoratedTop, getFocusedChild, getHeight, getHeightMode, getItemCount, getItemViewType, getLayoutDirection, getLeftDecorationWidth, getMinimumHeight, getMinimumWidth, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPosition, getProperties, getRightDecorationWidth, getRowCountForAccessibility, getSelectionModeForAccessibility, getTopDecorationHeight, getWidth, getWidthMode, hasFocus, ignoreView, isAttachedToWindow, isAutoMeasureEnabled, isFocused, isLayoutHierarchical, isMeasurementCacheEnabled, isSmoothScrolling, layoutDecorated, measureChild, measureChildWithMargins, moveView, offsetChildrenHorizontal, offsetChildrenVertical, onAddFocusables, onAttachedToWindow, onDetachedFromWindow, onDetachedFromWindow, onFocusSearchFailed, onInitializeAccessibilityEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onInitializeAccessibilityNodeInfoForItem, onInterceptFocusSearch, onItemsUpdated, onMeasure, onRequestChildFocus, onRequestChildFocus, onRestoreInstanceState, onSaveInstanceState, performAccessibilityAction, performAccessibilityActionForItem, postOnAnimation, removeAllViews, removeAndRecycleAllViews, removeAndRecycleView, removeAndRecycleViewAt, removeCallbacks, removeDetachedView, removeView, removeViewAt, requestChildRectangleOnScreen, requestLayout, requestSimpleAnimationsInNextLayout, setAutoMeasureEnabled, setMeasuredDimension, setMeasuredDimension, setMeasurementCacheEnabled, smoothScrollToPosition, startSmoothScroll, stopIgnoringView
public static final int HORIZONTAL
public static final int VERTICAL
public SlideLayoutManager(Context context)
SlideLayoutManager
class.context
- the context to be usedpublic SlideLayoutManager(Context context, int orientation)
SlideLayoutManager
class.context
- the context to be usedorientation
- specifies the layout orientation - HORIZONTAL
or VERTICAL
public boolean isScrollOnTap()
public void setScrollOnTap(boolean scrollOnTap)
scrollOnTap
- the new value that will determine if the adjacent items should become current when tappedpublic int getItemSpacing()
public void setItemSpacing(int itemSpacing)
itemSpacing
- the new item spacing between itemspublic SlideLayoutManager.Transition getTransitionMode()
public void setTransitionMode(SlideLayoutManager.Transition transitionMode)
transitionMode
- the new transition modepublic int getNextItemPreview()
public void setNextItemPreview(int nextItemPreview)
nextItemPreview
- the new value for pixels visible from the next itempublic int getPreviousItemPreview()
public void setPreviousItemPreview(int previousItemPreview)
previousItemPreview
- the new value for pixels visible from the previous item