LinearSmoothScroller

RecyclerView.SmoothScroller implementation which uses a LinearInterpolator until the target position becomes a child of the RecyclerView and then uses a DecelerateInterpolator to slowly approach to target position.

If the RecyclerView.LayoutManager you are using does not implement the RecyclerView.SmoothScroller.ScrollVectorProvider interface, then you must override the computeScrollVectorForPosition method. All the LayoutManagers bundled with the support library implement this interface.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
val SNAP_TO_ANY: Int = 0
Decides if the child should be snapped from start or end, depending on where it currently is in relation to its parent.
Link copied to clipboard
val SNAP_TO_END: Int = 1
Align child view's right or bottom with parent view's right or bottom
Link copied to clipboard
val SNAP_TO_START: Int = -1
Align child view's left or top with parent view's left or top

Functions

Link copied to clipboard
open fun calculateDtToFit(viewStart: Int, viewEnd: Int, boxStart: Int, boxEnd: Int, snapPreference: Int): Int
Link copied to clipboard
open fun calculateDxToMakeVisible(view: View, snapPreference: Int): Int
Calculates the horizontal scroll amount necessary to make the given view fully visible inside the RecyclerView.
Link copied to clipboard
open fun calculateDyToMakeVisible(view: View, snapPreference: Int): Int
Calculates the vertical scroll amount necessary to make the given view fully visible inside the RecyclerView.