ScrollerCompat

Deprecated

Use OverScroller directly.

Provides access to new Scroller APIs when available.

This class provides a platform version-independent mechanism for obeying the current device's preferred scroll physics and fling behavior. It offers a subset of the APIs from Scroller or OverScroller.

Functions

Link copied to clipboard
open fun abortAnimation()
Stops the animation.
Link copied to clipboard
Call this when you want to know the new location.
Link copied to clipboard
open fun create(context: Context): ScrollerCompat
open fun create(context: Context, interpolator: Interpolator): ScrollerCompat
Link copied to clipboard
open fun fling(startX: Int, startY: Int, velocityX: Int, velocityY: Int, minX: Int, maxX: Int, minY: Int, maxY: Int)
open fun fling(startX: Int, startY: Int, velocityX: Int, velocityY: Int, minX: Int, maxX: Int, minY: Int, maxY: Int, overX: Int, overY: Int)
Start scrolling based on a fling gesture.
Link copied to clipboard
Returns the current velocity on platform versions that support it.
Link copied to clipboard
open fun getCurrX(): Int
Returns the current X offset in the scroll.
Link copied to clipboard
open fun getCurrY(): Int
Returns the current Y offset in the scroll.
Link copied to clipboard
open fun getFinalX(): Int
Link copied to clipboard
open fun getFinalY(): Int
Link copied to clipboard
open fun isFinished(): Boolean
Returns whether the scroller has finished scrolling.
Link copied to clipboard
Returns whether the current Scroller is currently returning to a valid position.
Link copied to clipboard
open fun notifyHorizontalEdgeReached(startX: Int, finalX: Int, overX: Int)
Notify the scroller that we've reached a horizontal boundary.
Link copied to clipboard
open fun notifyVerticalEdgeReached(startY: Int, finalY: Int, overY: Int)
Notify the scroller that we've reached a vertical boundary.
Link copied to clipboard
open fun springBack(startX: Int, startY: Int, minX: Int, maxX: Int, minY: Int, maxY: Int): Boolean
Call this when you want to 'spring back' into a valid coordinate range.
Link copied to clipboard
open fun startScroll(startX: Int, startY: Int, dx: Int, dy: Int)
open fun startScroll(startX: Int, startY: Int, dx: Int, dy: Int, duration: Int)
Start scrolling by providing a starting point and the distance to travel.