belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
Deprecated since version 26.1.0
ScrollerCompat
public
final
class
ScrollerCompat
extends Object
java.lang.Object | |
↳ | android.support.v4.widget.ScrollerCompat |
This class was deprecated
in API level 26.1.0.
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.
Summary
Public methods | |
---|---|
void
|
abortAnimation()
This method was deprecated
in API level 26.1.0.
Use |
boolean
|
computeScrollOffset()
This method was deprecated
in API level 26.1.0.
Use |
static
ScrollerCompat
|
create(Context context, Interpolator interpolator)
This method was deprecated
in API level 26.1.0.
Use |
static
ScrollerCompat
|
create(Context context)
This method was deprecated
in API level 26.1.0.
Use |
void
|
fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY)
This method was deprecated
in API level 26.1.0.
Use |
void
|
fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, int overX, int overY)
This method was deprecated
in API level 26.1.0.
Use |
float
|
getCurrVelocity()
This method was deprecated
in API level 26.1.0.
Use |
int
|
getCurrX()
This method was deprecated
in API level 26.1.0.
Use |
int
|
getCurrY()
This method was deprecated
in API level 26.1.0.
Use |
int
|
getFinalX()
This method was deprecated
in API level 26.1.0.
Use |
int
|
getFinalY()
This method was deprecated
in API level 26.1.0.
Use |
boolean
|
isFinished()
This method was deprecated
in API level 26.1.0.
Use |
boolean
|
isOverScrolled()
This method was deprecated
in API level 26.1.0.
Use |
void
|
notifyHorizontalEdgeReached(int startX, int finalX, int overX)
This method was deprecated
in API level 26.1.0.
Use |
void
|
notifyVerticalEdgeReached(int startY, int finalY, int overY)
This method was deprecated
in API level 26.1.0.
Use |
boolean
|
springBack(int startX, int startY, int minX, int maxX, int minY, int maxY)
This method was deprecated
in API level 26.1.0.
Use |
void
|
startScroll(int startX, int startY, int dx, int dy, int duration)
This method was deprecated
in API level 26.1.0.
Use |
void
|
startScroll(int startX, int startY, int dx, int dy)
This method was deprecated
in API level 26.1.0.
Use |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public methods
abortAnimation
void abortAnimation ()
This method was deprecated
in API level 26.1.0.
Use abortAnimation()
directly.
Stops the animation. Aborting the animation causes the scroller to move to the final x and y position.
computeScrollOffset
boolean computeScrollOffset ()
This method was deprecated
in API level 26.1.0.
Use computeScrollOffset()
directly.
Call this when you want to know the new location. If it returns true, the animation is not yet finished. loc will be altered to provide the new location.
Returns | |
---|---|
boolean |
create
ScrollerCompat create (Context context, Interpolator interpolator)
This method was deprecated
in API level 26.1.0.
Use OverScroller
constructor directly.
Parameters | |
---|---|
context |
Context |
interpolator |
Interpolator |
Returns | |
---|---|
ScrollerCompat |
create
ScrollerCompat create (Context context)
This method was deprecated
in API level 26.1.0.
Use OverScroller
constructor directly.
Parameters | |
---|---|
context |
Context |
Returns | |
---|---|
ScrollerCompat |
fling
void fling (int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY)
This method was deprecated
in API level 26.1.0.
Use fling(int, int, int, int, int, int, int, int)
directly.
Start scrolling based on a fling gesture. The distance travelled will depend on the initial velocity of the fling.
Parameters | |
---|---|
startX |
int : Starting point of the scroll (X) |
startY |
int : Starting point of the scroll (Y) |
velocityX |
int : Initial velocity of the fling (X) measured in pixels per
second. |
velocityY |
int : Initial velocity of the fling (Y) measured in pixels per
second |
minX |
int : Minimum X value. The scroller will not scroll past this
point. |
maxX |
int : Maximum X value. The scroller will not scroll past this
point. |
minY |
int : Minimum Y value. The scroller will not scroll past this
point. |
maxY |
int : Maximum Y value. The scroller will not scroll past this
point. |
fling
void fling (int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, int overX, int overY)
This method was deprecated
in API level 26.1.0.
Use fling(int, int, int, int, int, int, int, int, int, int)
directly.
Start scrolling based on a fling gesture. The distance travelled will depend on the initial velocity of the fling.
Parameters | |
---|---|
startX |
int : Starting point of the scroll (X) |
startY |
int : Starting point of the scroll (Y) |
velocityX |
int : Initial velocity of the fling (X) measured in pixels per
second. |
velocityY |
int : Initial velocity of the fling (Y) measured in pixels per
second |
minX |
int : Minimum X value. The scroller will not scroll past this
point. |
maxX |
int : Maximum X value. The scroller will not scroll past this
point. |
minY |
int : Minimum Y value. The scroller will not scroll past this
point. |
maxY |
int : Maximum Y value. The scroller will not scroll past this
point. |
overX |
int : Overfling range. If > 0, horizontal overfling in either
direction will be possible. |
overY |
int : Overfling range. If > 0, vertical overfling in either
direction will be possible. |
getCurrVelocity
float getCurrVelocity ()
This method was deprecated
in API level 26.1.0.
Use getCurrVelocity()
directly.
Returns the current velocity on platform versions that support it.
This method should only be used as input for nonessential visual effects such as
EdgeEffectCompat
.
Returns | |
---|---|
float |
The original velocity less the deceleration. Result may be negative. |
getCurrX
int getCurrX ()
This method was deprecated
in API level 26.1.0.
Use getCurrX()
directly.
Returns the current X offset in the scroll.
Returns | |
---|---|
int |
The new X offset as an absolute distance from the origin. |
getCurrY
int getCurrY ()
This method was deprecated
in API level 26.1.0.
Use getCurrY()
directly.
Returns the current Y offset in the scroll.
Returns | |
---|---|
int |
The new Y offset as an absolute distance from the origin. |
getFinalX
int getFinalX ()
This method was deprecated
in API level 26.1.0.
Use getFinalX()
directly.
Returns | |
---|---|
int |
The final X position for the scroll in progress, if known. |
getFinalY
int getFinalY ()
This method was deprecated
in API level 26.1.0.
Use getFinalY()
directly.
Returns | |
---|---|
int |
The final Y position for the scroll in progress, if known. |
isFinished
boolean isFinished ()
This method was deprecated
in API level 26.1.0.
Use isFinished()
directly.
Returns whether the scroller has finished scrolling.
Returns | |
---|---|
boolean |
True if the scroller has finished scrolling, false otherwise. |
isOverScrolled
boolean isOverScrolled ()
This method was deprecated
in API level 26.1.0.
Use isOverScrolled()
directly.
Returns whether the current Scroller is currently returning to a valid position.
Valid bounds were provided by the
fling(int, int, int, int, int, int, int, int, int, int)
method.
One should check this value before calling
startScroll(int, int, int, int)
as the interpolation currently in progress
to restore a valid position will then be stopped. The caller has to take into account
the fact that the started scroll will start from an overscrolled position.
Returns | |
---|---|
boolean |
true when the current position is overscrolled and in the process of interpolating back to a valid value. |
notifyHorizontalEdgeReached
void notifyHorizontalEdgeReached (int startX, int finalX, int overX)
This method was deprecated
in API level 26.1.0.
Use notifyHorizontalEdgeReached(int, int, int)
directly.
Notify the scroller that we've reached a horizontal boundary. Normally the information to handle this will already be known when the animation is started, such as in a call to one of the fling functions. However there are cases where this cannot be known in advance. This function will transition the current motion and animate from startX to finalX as appropriate.
Parameters | |
---|---|
startX |
int : Starting/current X position |
finalX |
int : Desired final X position |
overX |
int : Magnitude of overscroll allowed. This should be the maximum
desired distance from finalX. Absolute value - must be positive. |
notifyVerticalEdgeReached
void notifyVerticalEdgeReached (int startY, int finalY, int overY)
This method was deprecated
in API level 26.1.0.
Use notifyVerticalEdgeReached(int, int, int)
directly.
Notify the scroller that we've reached a vertical boundary. Normally the information to handle this will already be known when the animation is started, such as in a call to one of the fling functions. However there are cases where this cannot be known in advance. This function will animate a parabolic motion from startY to finalY.
Parameters | |
---|---|
startY |
int : Starting/current Y position |
finalY |
int : Desired final Y position |
overY |
int : Magnitude of overscroll allowed. This should be the maximum
desired distance from finalY. Absolute value - must be positive. |
springBack
boolean springBack (int startX, int startY, int minX, int maxX, int minY, int maxY)
This method was deprecated
in API level 26.1.0.
Use springBack(int, int, int, int, int, int)
directly.
Call this when you want to 'spring back' into a valid coordinate range.
Parameters | |
---|---|
startX |
int : Starting X coordinate |
startY |
int : Starting Y coordinate |
minX |
int : Minimum valid X value |
maxX |
int : Maximum valid X value |
minY |
int : Minimum valid Y value |
maxY |
int : Maximum valid Y value |
Returns | |
---|---|
boolean |
true if a springback was initiated, false if startX and startY were already within the valid range. |
startScroll
void startScroll (int startX, int startY, int dx, int dy, int duration)
This method was deprecated
in API level 26.1.0.
Use startScroll(int, int, int, int, int)
directly.
Start scrolling by providing a starting point and the distance to travel.
Parameters | |
---|---|
startX |
int : Starting horizontal scroll offset in pixels. Positive
numbers will scroll the content to the left. |
startY |
int : Starting vertical scroll offset in pixels. Positive numbers
will scroll the content up. |
dx |
int : Horizontal distance to travel. Positive numbers will scroll the
content to the left. |
dy |
int : Vertical distance to travel. Positive numbers will scroll the
content up. |
duration |
int : Duration of the scroll in milliseconds. |
startScroll
void startScroll (int startX, int startY, int dx, int dy)
This method was deprecated
in API level 26.1.0.
Use getCurrX()
directly.
Start scrolling by providing a starting point and the distance to travel. The scroll will use the default value of 250 milliseconds for the duration.
Parameters | |
---|---|
startX |
int : Starting horizontal scroll offset in pixels. Positive
numbers will scroll the content to the left. |
startY |
int : Starting vertical scroll offset in pixels. Positive numbers
will scroll the content up. |
dx |
int : Horizontal distance to travel. Positive numbers will scroll the
content to the left. |
dy |
int : Vertical distance to travel. Positive numbers will scroll the
content up. |
Interfaces
Classes
- AutoScrollHelper
- CircularProgressDrawable
- CompoundButtonCompat
- ContentLoadingProgressBar
- CursorAdapter
- DrawerLayout
- DrawerLayout.LayoutParams
- DrawerLayout.SavedState
- DrawerLayout.SimpleDrawerListener
- EdgeEffectCompat
- ExploreByTouchHelper
- ImageViewCompat
- ListPopupWindowCompat
- ListViewAutoScrollHelper
- ListViewCompat
- NestedScrollView
- PopupMenuCompat
- PopupWindowCompat
- ResourceCursorAdapter
- ScrollerCompat
- SimpleCursorAdapter
- SlidingPaneLayout
- SlidingPaneLayout.LayoutParams
- SlidingPaneLayout.SimplePanelSlideListener
- Space
- SwipeRefreshLayout
- TextViewCompat
- ViewDragHelper
- ViewDragHelper.Callback