Class FixedLinearLayoutManager

  • All Implemented Interfaces:
    androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler , androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider

    
    public class FixedLinearLayoutManager
    extends LinearLayoutManager
                        

    Workaround for a known RecyclerView bug: wraps LinearLayoutManager and catches IndexOutOfBoundsException in onLayoutChildren().

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int HORIZONTAL
      public final static int VERTICAL
      public final static int INVALID_OFFSET
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state)
      • Methods inherited from class androidx.recyclerview.widget.LinearLayoutManager

        assertNotInLayoutOrScroll, calculateExtraLayoutSpace, canScrollHorizontally, canScrollVertically, collectAdjacentPrefetchPositions, collectInitialPrefetchPositions, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScrollVectorForPosition, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, findFirstCompletelyVisibleItemPosition, findFirstVisibleItemPosition, findLastCompletelyVisibleItemPosition, findLastVisibleItemPosition, findViewByPosition, generateDefaultLayoutParams, getExtraLayoutSpace, getInitialPrefetchItemCount, getOrientation, getRecycleChildrenOnDetach, getReverseLayout, getStackFromEnd, isAutoMeasureEnabled, isLayoutRTL, isSmoothScrollbarEnabled, onDetachedFromWindow, onFocusSearchFailed, onInitializeAccessibilityEvent, onLayoutCompleted, onRestoreInstanceState, onSaveInstanceState, prepareForDrop, scrollHorizontallyBy, scrollToPosition, scrollToPositionWithOffset, scrollVerticallyBy, setInitialPrefetchItemCount, setOrientation, setRecycleChildrenOnDetach, setReverseLayout, setSmoothScrollbarEnabled, setStackFromEnd, smoothScrollToPosition, supportsPredictiveItemAnimations
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.LayoutManager

        addDisappearingView, addView, assertInLayoutOrScroll, attachView, calculateItemDecorationsForChild, checkLayoutParams, chooseSize, detachAndScrapAttachedViews, detachAndScrapView, detachAndScrapViewAt, detachView, detachViewAt, endAnimation, findContainingItemView, generateLayoutParams, getBaseline, getBottomDecorationHeight, getChildAt, getChildCount, getChildMeasureSpec, getClipToPadding, getColumnCountForAccessibility, getDecoratedBottom, getDecoratedBoundsWithMargins, 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, getTransformedBoundingBox, getWidth, getWidthMode, hasFocus, ignoreView, isAttachedToWindow, isFocused, isItemPrefetchEnabled, isLayoutHierarchical, isMeasurementCacheEnabled, isSmoothScrolling, isViewPartiallyVisible, layoutDecorated, layoutDecoratedWithMargins, measureChild, measureChildWithMargins, moveView, offsetChildrenHorizontal, offsetChildrenVertical, onAdapterChanged, onAddFocusables, onAttachedToWindow, onInterceptFocusSearch, onItemsAdded, onItemsChanged, onItemsMoved, onItemsRemoved, onItemsUpdated, onMeasure, onRequestChildFocus, onScrollStateChanged, postOnAnimation, removeAllViews, removeAndRecycleAllViews, removeAndRecycleView, removeAndRecycleViewAt, removeCallbacks, removeDetachedView, removeView, removeViewAt, requestChildRectangleOnScreen, requestLayout, requestSimpleAnimationsInNextLayout, setAutoMeasureEnabled, setItemPrefetchEnabled, setMeasuredDimension, setMeasurementCacheEnabled, startSmoothScroll, stopIgnoringView
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedLinearLayoutManager

        FixedLinearLayoutManager(Context context)
      • FixedLinearLayoutManager

        FixedLinearLayoutManager(Context context, int orientation, boolean reverseLayout)
      • FixedLinearLayoutManager

        FixedLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
    • Method Detail

      • onLayoutChildren

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