OverScroller
public
class
OverScroller
extends Object
| java.lang.Object | |
| ↳ | android.widget.OverScroller |
This class encapsulates scrolling with the ability to overshoot the bounds
of a scrolling operation. This class is a drop-in replacement for
Scroller in most cases.
Summary
Public constructors | |
|---|---|
OverScroller(Context context)
Creates an OverScroller with a viscous fluid scroll interpolator and flywheel. |
|
OverScroller(Context context, Interpolator interpolator)
Creates an OverScroller with flywheel enabled. |
|
OverScroller(Context context, Interpolator interpolator, float bounceCoefficientX, float bounceCoefficientY)
This constructor is deprecated.
Use |
|
OverScroller(Context context, Interpolator interpolator, float bounceCoefficientX, float bounceCoefficientY, boolean flywheel)
This constructor is deprecated.
Use |
|
Public methods | |
|---|---|
void
|
abortAnimation()
Stops the animation. |
boolean
|
computeScrollOffset()
Call this when you want to know the new location. |
void
|
fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY)
|
void
|
fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, int overX, int overY)
Start scrolling based on a fling gesture. |
final
void
|
forceFinished(boolean finished)
Force the finished field to a particular value. |
float
|
getCurrVelocity()
Returns the absolute value of the current velocity. |
final
int
|
getCurrX()
Returns the current X offset in the scroll. |
final
int
|
getCurrY()
Returns the current Y offset in the scroll. |
final
int
|
getFinalX()
Returns where the scroll will end. |
final
int
|
getFinalY()
Returns where the scroll will end. |
final
int
|
getStartX()
Returns the start X offset in the scroll. |
final
int
|
getStartY()
Returns the start Y offset in the scroll. |
final
boolean
|
isFinished()
Returns whether the scroller has finished scrolling. |
boolean
|
isOverScrolled()
Returns whether the current Scroller is currently returning to a valid position. |
void
|
notifyHorizontalEdgeReached(int startX, int finalX, int overX)
Notify the scroller that we've reached a horizontal boundary. |
void
|
|