public class DeckOfCardsLayoutManager extends SlideLayoutManagerBase
RecyclerView.LayoutManager
implementation that lays out items in a way
which resembles a deck of cards where one item is fully visible and there are additional
items which are visible in perspective.RecyclerView.LayoutManager.Properties
Modifier and Type | Field and Description |
---|---|
static int |
HORIZONTAL |
static int |
VERTICAL |
Constructor and Description |
---|
DeckOfCardsLayoutManager(Context context)
Creates an instance of the
DeckOfCardsLayoutManager class. |
DeckOfCardsLayoutManager(Context context,
int orientation,
boolean reverseLayout)
Creates an instance of the
DeckOfCardsLayoutManager class. |
Modifier and Type | Method and Description |
---|---|
int |
computeHorizontalScrollExtent(RecyclerView.State state) |
int |
computeHorizontalScrollOffset(RecyclerView.State state) |
int |
computeHorizontalScrollRange(RecyclerView.State state) |
PointF |
computeScrollVectorForPosition(int targetPosition) |
int |
computeVerticalScrollExtent(RecyclerView.State state) |
int |
computeVerticalScrollOffset(RecyclerView.State state) |
int |
computeVerticalScrollRange(RecyclerView.State state) |
RecyclerView.LayoutParams |
generateDefaultLayoutParams() |
int |
getPerspectiveItemsCount()
Gets the number of items which should be seen in perspective.
|
boolean |
isAutoDissolveFrontView()
Indicates whether the current item should automatically dissolve when swiped away.
|
void |
onRestoreInstanceState(Parcelable state) |
Parcelable |
onSaveInstanceState() |
PerspectiveChangeInfo |
perspective()
Provides access to a
PerspectiveChangeInfo instance which contains information
about the transformations that will be applied to items in perspective. |
void |
setAutoDissolveFrontView(boolean changeFrontViewAlpha)
Sets a value indicating whether the current item should automatically dissolve when swiped away.
|
void |
setPerspectiveItemsCount(int perspectiveItemsCount)
Sets a number which indicates how many items should be seen in perspective.
|
void |
smoothScrollToPosition(RecyclerView recyclerView,
RecyclerView.State state,
int position) |
addListener, canScrollHorizontally, canScrollVertically, 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, 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, performAccessibilityAction, performAccessibilityActionForItem, postOnAnimation, removeAllViews, removeAndRecycleAllViews, removeAndRecycleView, removeAndRecycleViewAt, removeCallbacks, removeDetachedView, removeView, removeViewAt, requestChildRectangleOnScreen, requestLayout, requestSimpleAnimationsInNextLayout, setAutoMeasureEnabled, setMeasuredDimension, setMeasuredDimension, setMeasurementCacheEnabled, startSmoothScroll, stopIgnoringView
public static final int HORIZONTAL
public static final int VERTICAL
public DeckOfCardsLayoutManager(Context context)
DeckOfCardsLayoutManager
class.context
- the context to be usedpublic DeckOfCardsLayoutManager(Context context, int orientation, boolean reverseLayout)
DeckOfCardsLayoutManager
class.context
- the context to be usedorientation
- specifies the layout orientation - HORIZONTAL
or VERTICAL
reverseLayout
- when set to true, layouts from end to startpublic PerspectiveChangeInfo perspective()
PerspectiveChangeInfo
instance which contains information
about the transformations that will be applied to items in perspective.public boolean isAutoDissolveFrontView()
public void setAutoDissolveFrontView(boolean changeFrontViewAlpha)
changeFrontViewAlpha
- the new value that will determine if the current item should automatically dissolve when swiped away.public int getPerspectiveItemsCount()
public void setPerspectiveItemsCount(int perspectiveItemsCount)
perspectiveItemsCount
- number of items that should be seen in perspective.public Parcelable onSaveInstanceState()
onSaveInstanceState
in class RecyclerView.LayoutManager
public void onRestoreInstanceState(Parcelable state)
onRestoreInstanceState
in class RecyclerView.LayoutManager
public RecyclerView.LayoutParams generateDefaultLayoutParams()
generateDefaultLayoutParams
in class SlideLayoutManagerBase
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position)
smoothScrollToPosition
in class RecyclerView.LayoutManager
public PointF computeScrollVectorForPosition(int targetPosition)
public int computeHorizontalScrollExtent(RecyclerView.State state)
computeHorizontalScrollExtent
in class RecyclerView.LayoutManager
public int computeHorizontalScrollOffset(RecyclerView.State state)
computeHorizontalScrollOffset
in class RecyclerView.LayoutManager
public int computeHorizontalScrollRange(RecyclerView.State state)
computeHorizontalScrollRange
in class RecyclerView.LayoutManager
public int computeVerticalScrollExtent(RecyclerView.State state)
computeVerticalScrollExtent
in class RecyclerView.LayoutManager
public int computeVerticalScrollOffset(RecyclerView.State state)
computeVerticalScrollOffset
in class RecyclerView.LayoutManager
public int computeVerticalScrollRange(RecyclerView.State state)
computeVerticalScrollRange
in class RecyclerView.LayoutManager