Constructors

Link copied to clipboard
constructor(context: Context)
Creates a vertical LinearLayoutManager
constructor(context: Context, orientation: Int, reverseLayout: Boolean)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)
Constructor used when layout manager is set in XML by RecyclerView attribute "layoutManager".

Types

Link copied to clipboard
open class SavedState : Parcelable
Link copied to clipboard

Properties

Link copied to clipboard
val HORIZONTAL: Int = 0
Link copied to clipboard
val INVALID_OFFSET: Int = -2147483648
Link copied to clipboard
val VERTICAL: Int = 1

Functions

Link copied to clipboard
Checks if RecyclerView is in the middle of a layout or scroll and throws an IllegalStateException if it is.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Gather all positions from the LayoutManager to be prefetched, given specified momentum.
Link copied to clipboard
Gather all positions from the LayoutManager to be prefetched in preperation for its RecyclerView to come on screen, due to the movement of another, containing RecyclerView.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
open fun computeScrollVectorForPosition(targetPosition: Int): PointF
Should calculate the vector that points to the direction where the target position can be found.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
Override this method if you want to support scroll bars.
Link copied to clipboard
Returns the adapter position of the first fully visible view.
Link copied to clipboard
Returns the adapter position of the first visible view.
Link copied to clipboard
Returns the adapter position of the last fully visible view.
Link copied to clipboard
Returns the adapter position of the last visible view.
Link copied to clipboard
open fun findViewByPosition(position: Int): View
Finds the view which represents the given adapter position.
Link copied to clipboard
Create a default LayoutParams object for a child of the RecyclerView.
Link copied to clipboard
Gets the number of items to prefetch in collectInitialPrefetchPositions, which defines how many inner items should be prefetched when this LayoutManager's RecyclerView is nested inside another RecyclerView.
Link copied to clipboard
open fun getOrientation(): Int
Returns the current orientation of the layout.
Link copied to clipboard
Returns whether LayoutManager will recycle its children when it is detached from RecyclerView.
Link copied to clipboard
Returns if views are laid out from the opposite direction of the layout.
Link copied to clipboard
Link copied to clipboard
Returns whether the measuring pass of layout should use the AutoMeasure mechanism of RecyclerView or if it should be done by the LayoutManager's implementation of onMeasure.
Link copied to clipboard
Query if the layout is in reverse order.
Link copied to clipboard
Returns the current state of the smooth scrollbar feature.
Link copied to clipboard
Called when this LayoutManager is detached from its parent RecyclerView or when its parent RecyclerView is detached from its window.
Link copied to clipboard
open fun onFocusSearchFailed(focused: View, direction: Int, recycler: RecyclerView.Recycler, state: RecyclerView.State): View
Called when searching for a focusable view in the given direction has failed for the current content of the RecyclerView.
Link copied to clipboard
Called by the AccessibilityDelegate when the information about the current layout should be populated.
Link copied to clipboard
Lay out all relevant child views from the given adapter.
Link copied to clipboard
Called after a full layout calculation is finished.
Link copied to clipboard
Called when the RecyclerView is ready to restore the state based on a previous RecyclerView.
Link copied to clipboard
Called when the LayoutManager should save its state.
Link copied to clipboard
open fun prepareForDrop(@NonNull view: View, @NonNull target: View, x: Int, y: Int)
Called by the after a View is dropped over another View.
Link copied to clipboard
Scroll horizontally by dx pixels in screen coordinates and return the distance traveled.
Link copied to clipboard
open fun scrollToPosition(position: Int)
Scroll the RecyclerView to make the position visible.
Link copied to clipboard
open fun scrollToPositionWithOffset(position: Int, offset: Int)
Scroll to the specified adapter position with the given offset from resolved layout start.
Link copied to clipboard
Scroll vertically by dy pixels in screen coordinates and return the distance traveled.
Link copied to clipboard
open fun setInitialPrefetchItemCount(itemCount: Int)
Sets the number of items to prefetch in collectInitialPrefetchPositions, which defines how many inner items should be prefetched when this LayoutManager's RecyclerView is nested inside another RecyclerView.
Link copied to clipboard
open fun setOrientation(orientation: Int)
Sets the orientation of the layout.
Link copied to clipboard
open fun setRecycleChildrenOnDetach(recycleChildrenOnDetach: Boolean)
Set whether LayoutManager will recycle its children when it is detached from RecyclerView.
Link copied to clipboard
open fun setReverseLayout(reverseLayout: Boolean)
Used to reverse item traversal and layout order.
Link copied to clipboard
When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed based on the number of visible pixels in the visible items.
Link copied to clipboard
open fun setStackFromEnd(stackFromEnd: Boolean)
Compatibility support for setStackFromBottom
Link copied to clipboard
open fun smoothScrollToPosition(recyclerView: RecyclerView, state: RecyclerView.State, position: Int)
Smooth scroll to the specified adapter position.
Link copied to clipboard
Returns whether this LayoutManager supports "predictive item animations".