WearableRecyclerView.ChildLayoutManager

public static abstract class WearableRecyclerView.ChildLayoutManager
extends LinearLayoutManager

java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.LayoutManager
     ↳ android.support.v7.widget.LinearLayoutManager
       ↳ android.support.wearable.view.WearableRecyclerView.ChildLayoutManager
CurvedChildLayoutManager This class is deprecated. use the androidx.wear.widget.WearableRecyclerView and associated classes provided by the Jetpack Wear library instead.  


This class is deprecated.
use the androidx.wear.widget.WearableRecyclerView provided by the Jetpack Wear library instead.

Abstract class extending a LinearLayoutManager for defining the logic for updating layouts of children in a WearableRecyclerView. Use this class if you wish to modify the appearance of a child based on their position in the WearableRecyclerView by overriding the abstract method updateChild(View, WearableRecyclerView). This method will be called on every layout pass of for the associated WearableRecyclerView. To associated this RecyclerView.LayoutManager with a WearableRecyclerView use the RecyclerView.setLayoutManager(LayoutManager) methods.

Summary

Inherited constants

int HORIZONTAL

int INVALID_OFFSET

int VERTICAL

Public constructors

ChildLayoutManager(Context context)

Creates a WearableRecyclerView.ChildLayoutManager for a vertical list.

Public methods

void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state)
int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state)
abstract void updateChild(View child, WearableRecyclerView parent)

Override this method to implement custom child layout behavior on scroll.

Inherited methods

void assertNotInLayoutOrScroll(String arg0)
void calculateExtraLayoutSpace(RecyclerView.State arg0, int[] arg1)
boolean canScrollHorizontally()
boolean canScrollVertically()
void collectAdjacentPrefetchPositions(int arg0, int arg1, RecyclerView.State arg2, RecyclerView.LayoutManager.LayoutPrefetchRegistry arg3)
void collectInitialPrefetchPositions(int arg0, RecyclerView.LayoutManager.LayoutPrefetchRegistry arg1)
int computeHorizontalScrollExtent(RecyclerView.State arg0)
int computeHorizontalScrollOffset(RecyclerView.State arg0)
int computeHorizontalScrollRange(RecyclerView.State arg0)
PointF computeScrollVectorForPosition(int arg0)
int computeVerticalScrollExtent(RecyclerView.State arg0)
int computeVerticalScrollOffset(RecyclerView.State arg0)
int computeVerticalScrollRange(RecyclerView.State arg0)
int findFirstCompletelyVisibleItemPosition()
int findFirstVisibleItemPosition()
int findLastCompletelyVisibleItemPosition()
int findLastVisibleItemPosition()
View findViewByPosition(int arg0)
RecyclerView.LayoutParams generateDefaultLayoutParams()
int getExtraLayoutSpace(RecyclerView.State arg0)
int getInitialPrefetchItemCount()
int getOrientation()
boolean getRecycleChildrenOnDetach()
boolean getReverseLayout()
boolean getStackFromEnd()
boolean isAutoMeasureEnabled()
boolean isLayoutRTL()
boolean isSmoothScrollbarEnabled()
void onDetachedFromWindow(RecyclerView arg0, RecyclerView.Recycler arg1)
View onFocusSearchFailed(View arg0, int arg1, RecyclerView.Recycler arg2, RecyclerView.State arg3)
void onInitializeAccessibilityEvent(AccessibilityEvent arg0)
void onLayoutChildren(RecyclerView.Recycler arg0, RecyclerView.State arg1)
void onLayoutCompleted(RecyclerView.State arg0)
void onRestoreInstanceState(Parcelable arg0)
Parcelable onSaveInstanceState()
void prepareForDrop(View arg0, View arg1, int arg2, int arg3)
int scrollHorizontallyBy(int arg0, RecyclerView.Recycler arg1, RecyclerView.State arg2)
void scrollToPosition(int arg0)
void scrollToPositionWithOffset(int arg0, int arg1)
int scrollVerticallyBy(int arg0, RecyclerView.Recycler arg1, RecyclerView.State arg2)
void setInitialPrefetchItemCount(int arg0)
void setOrientation(int arg0)
void setRecycleChildrenOnDetach(boolean arg0)
void setReverseLayout(boolean arg0)
void setSmoothScrollbarEnabled(boolean arg0)
void setStackFromEnd(boolean arg0)
void smoothScrollToPosition(RecyclerView arg0, RecyclerView.State arg1, int arg2)
boolean supportsPredictiveItemAnimations()
void addDisappearingView(View arg0, int arg1)
void addDisappearingView(View arg0)
void addView(View arg0, int arg1)
void addView(View arg0)
void assertInLayoutOrScroll(String arg0)
void assertNotInLayoutOrScroll(String arg0)
void attachView(View arg0)
void attachView(View arg0, int arg1)
void attachView(View arg0, int arg1, RecyclerView.LayoutParams arg2)
void calculateItemDecorationsForChild(View arg0, Rect arg1)
boolean canScrollHorizontally()
boolean canScrollVertically()
boolean checkLayoutParams(RecyclerView.LayoutParams arg0)
static int chooseSize(int arg0, int arg1, int arg2)
void collectAdjacentPrefetchPositions(int arg0, int arg1, RecyclerView.State arg2, RecyclerView.LayoutManager.LayoutPrefetchRegistry arg3)
void collectInitialPrefetchPositions(int arg0, RecyclerView.LayoutManager.LayoutPrefetchRegistry arg1)
int computeHorizontalScrollExtent(RecyclerView.State arg0)
int computeHorizontalScrollOffset(RecyclerView.State arg0)
int computeHorizontalScrollRange(RecyclerView.State arg0)
int computeVerticalScrollExtent(RecyclerView.State arg0)
int computeVerticalScrollOffset(RecyclerView.State arg0)
int computeVerticalScrollRange(RecyclerView.State arg0)
void detachAndScrapAttachedViews(RecyclerView.Recycler arg0)
void detachAndScrapView(View arg0, RecyclerView.Recycler arg1)
void detachAndScrapViewAt(int arg0, RecyclerView.Recycler arg1)
void detachView(View arg0)
void detachViewAt(int arg0)
void endAnimation(View arg0)
View findContainingItemView(View arg0)
View findViewByPosition(int arg0)
abstract RecyclerView.LayoutParams generateDefaultLayoutParams()
RecyclerView.LayoutParams generateLayoutParams(Context arg0, AttributeSet arg1)
RecyclerView.LayoutParams generateLayoutParams(ViewGroup.LayoutParams arg0)
int getBaseline()
int getBottomDecorationHeight(View arg0)
View getChildAt(int arg0)
int getChildCount()
static int getChildMeasureSpec(int arg0, int arg1, int arg2, int arg3, boolean arg4)
static int getChildMeasureSpec(int arg0, int arg1, int arg2, boolean arg3)
boolean getClipToPadding()
int getColumnCountForAccessibility(RecyclerView.Recycler arg0, RecyclerView.State arg1)
int getDecoratedBottom(View arg0)
void getDecoratedBoundsWithMargins(View arg0, Rect arg1)
int getDecoratedLeft(View arg0)
int getDecoratedMeasuredHeight(View arg0)
int getDecoratedMeasuredWidth(View arg0)
int getDecoratedRight(View arg0)
int getDecoratedTop(View arg0)
View getFocusedChild()
int getHeight()
int getHeightMode()
int getItemCount()
int getItemViewType(View arg0)
int getLayoutDirection()
int getLeftDecorationWidth(View arg0)
int getMinimumHeight()
int getMinimumWidth()
int getPaddingBottom()
int getPaddingEnd()
int getPaddingLeft()
int getPaddingRight()
int getPaddingStart()
int getPaddingTop()
int getPosition(View arg0)
static RecyclerView.LayoutManager.Properties getProperties(Context arg0, AttributeSet arg1, int arg2, int arg3)
int getRightDecorationWidth(View arg0)
int getRowCountForAccessibility(RecyclerView.Recycler arg0, RecyclerView.State arg1)
int getSelectionModeForAccessibility(RecyclerView.Recycler arg0, RecyclerView.State arg1)
int getTopDecorationHeight(View arg0)
void getTransformedBoundingBox(View arg0, boolean arg1, Rect arg2)
int getWidth()
int getWidthMode()
boolean hasFocus()
void ignoreView(View arg0)
boolean isAttachedToWindow()
boolean isAutoMeasureEnabled()
boolean isFocused()
final boolean isItemPrefetchEnabled()
boolean isLayoutHierarchical(RecyclerView.Recycler arg0, RecyclerView.State arg1)
boolean isMeasurementCacheEnabled()
boolean isSmoothScrolling()
boolean isViewPartiallyVisible(View arg0, boolean arg1, boolean arg2)
void layoutDecorated(View arg0, int arg1, int arg2, int arg3, int arg4)
void layoutDecoratedWithMargins(View arg0, int arg1, int arg2, int arg3, int arg4)
void measureChild(View arg0, int arg1, int arg2)
void measureChildWithMargins(View arg0, int arg1, int arg2)
void moveView(int arg0, int arg1)
void offsetChildrenHorizontal(int arg0)
void offsetChildrenVertical(int arg0)
void onAdapterChanged(Adapter arg0, Adapter arg1)
boolean onAddFocusables(RecyclerView arg0, ArrayList<View> arg1, int arg2, int arg3)
void onAttachedToWindow(RecyclerView arg0)
void onDetachedFromWindow(RecyclerView arg0, RecyclerView.Recycler arg1)
void onDetachedFromWindow(RecyclerView arg0)
View onFocusSearchFailed(View arg0, int arg1, RecyclerView.Recycler arg2, RecyclerView.State arg3)
void onInitializeAccessibilityEvent(AccessibilityEvent arg0)
void onInitializeAccessibilityEvent(RecyclerView.Recycler arg0, RecyclerView.State arg1, AccessibilityEvent arg2)
void onInitializeAccessibilityNodeInfo(RecyclerView.Recycler arg0, RecyclerView.State arg1, AccessibilityNodeInfoCompat arg2)
void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler arg0, RecyclerView.State arg1, View arg2, AccessibilityNodeInfoCompat arg3)
View onInterceptFocusSearch(View arg0, int arg1)
void onItemsAdded(RecyclerView arg0, int arg1, int arg2)
void onItemsChanged(RecyclerView arg0)
void onItemsMoved(RecyclerView arg0, int arg1, int arg2, int arg3)
void onItemsRemoved(RecyclerView arg0, int arg1, int arg2)
void onItemsUpdated(RecyclerView arg0, int arg1, int arg2)
void onItemsUpdated(RecyclerView arg0, int arg1, int arg2, Object arg3)
void onLayoutChildren(RecyclerView.Recycler arg0, RecyclerView.State arg1)
void onLayoutCompleted(RecyclerView.State arg0)
void onMeasure(RecyclerView.Recycler arg0, RecyclerView.State arg1, int arg2, int arg3)
boolean onRequestChildFocus(RecyclerView arg0, View arg1, View arg2)
boolean onRequestChildFocus(RecyclerView arg0, RecyclerView.State arg1, View arg2, View arg3)
void onRestoreInstanceState(Parcelable arg0)
Parcelable onSaveInstanceState()
void onScrollStateChanged(int arg0)
boolean performAccessibilityAction(RecyclerView.Recycler arg0, RecyclerView.State arg1, int arg2, Bundle arg3)
boolean performAccessibilityActionForItem(RecyclerView.Recycler arg0, RecyclerView.State arg1, View arg2, int arg3, Bundle arg4)
void postOnAnimation(Runnable arg0)
void removeAllViews()
void removeAndRecycleAllViews(RecyclerView.Recycler arg0)
void removeAndRecycleView(View arg0, RecyclerView.Recycler arg1)
void removeAndRecycleViewAt(int arg0, RecyclerView.Recycler arg1)
boolean removeCallbacks(Runnable arg0)
void removeDetachedView(View arg0)
void removeView(View arg0)
void removeViewAt(int arg0)
boolean requestChildRectangleOnScreen(RecyclerView arg0, View arg1, Rect arg2, boolean arg3, boolean arg4)
boolean requestChildRectangleOnScreen(RecyclerView arg0, View arg1, Rect arg2, boolean arg3)
void requestLayout()
void requestSimpleAnimationsInNextLayout()
int scrollHorizontallyBy(int arg0, RecyclerView.Recycler arg1, RecyclerView.State arg2)
void scrollToPosition(int arg0)
int scrollVerticallyBy(int arg0, RecyclerView.Recycler arg1, RecyclerView.State arg2)
void setAutoMeasureEnabled(boolean arg0)
final void setItemPrefetchEnabled(boolean arg0)
void setMeasuredDimension(int arg0, int arg1)
void setMeasuredDimension(Rect arg0, int arg1, int arg2)
void setMeasurementCacheEnabled(boolean arg0)
void smoothScrollToPosition(RecyclerView arg0, RecyclerView.State arg1, int arg2)
void startSmoothScroll(RecyclerView.SmoothScroller arg0)
void stopIgnoringView(View arg0)
boolean supportsPredictiveItemAnimations()
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()
abstract void prepareForDrop(View arg0, View arg1, int arg2, int arg3)
abstract PointF computeScrollVectorForPosition(int arg0)

Public constructors

ChildLayoutManager

public ChildLayoutManager (Context context)

Creates a WearableRecyclerView.ChildLayoutManager for a vertical list.

Parameters
context Context: Current context, will be used to access resources.

Public methods

onLayoutChildren

public void onLayoutChildren (RecyclerView.Recycler recycler, 
                RecyclerView.State state)

Parameters
recycler RecyclerView.Recycler

state RecyclerView.State

scrollVerticallyBy

public int scrollVerticallyBy (int dy, 
                RecyclerView.Recycler recycler, 
                RecyclerView.State state)

Parameters
dy int

recycler RecyclerView.Recycler

state RecyclerView.State

Returns
int

updateChild

public abstract void updateChild (View child, 
                WearableRecyclerView parent)

Override this method to implement custom child layout behavior on scroll. It is called at the end of each layout pass of the view and enables you to modify any property of the child view. Examples include scaling the children based on their distance from the center of the parent, or changing the translation of the children to create an ilusion of the path they are moving along.

Parameters
child View: the current child to be affected.

parent WearableRecyclerView: the WearableRecyclerView parent that this helper is attached to.