Public 成员函数 | |
| Rotator (Context context) | |
| final boolean | isFinished () |
| final void | forceFinished (boolean finished) |
| final long | getDuration () |
| final float | getCurrAngle () |
| float | getCurrVelocity () |
| final float | getStartAngle () |
| int | timePassed () |
| void | extendDuration (int extend) |
| void | abortAnimation () |
| boolean | computeAngleOffset () |
| void | startRotate (float startAngle, float dAngle, int duration) |
| void | startRotate (float startAngle, float dAngle) |
| void | fling (float velocityAngle) |
Private 属性 | |
| int | mMode |
| float | mStartAngle |
| float | mCurrAngle |
| long | mStartTime |
| long | mDuration |
| float | mDeltaAngle |
| boolean | mFinished |
| float | mCoeffVelocity = 0.05f |
| float | mVelocity |
| final float | mDeceleration = 240.0f |
静态 Private 属性 | |
| static final int | DEFAULT_DURATION = 250 |
| static final int | SCROLL_MODE = 0 |
| static final int | FLING_MODE = 1 |
This class encapsulates rotation. The duration of the rotation can be passed in the constructor and specifies the maximum time that the rotation animation should take. Past this time, the rotation is automatically moved to its final stage and computeRotationOffset() will always return false to indicate that scrolling is over.
|
inline |
Create a Scroller with the specified interpolator. If the interpolator is null, the default (viscous) interpolator will be used.
| context | the context |
|
inline |
Stops the animation. Contrary to forceFinished(boolean), aborting the animating cause the scroller to move to the final x and y position
|
inline |
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.
|
inline |
Extend the scroll animation. This allows a running animation to scroll further and longer, when used with setFinalX(int) or setFinalY(int).
| extend | Additional time to scroll in milliseconds. |
|
inline |
Start scrolling based on a fling gesture. The distance travelled will depend on the initial velocity of the fling.
| velocityAngle | Initial velocity of the fling (X) measured in pixels per second. |
|
inline |
Force the finished field to a particular value.
| finished | The new finished value. |
|
inline |
Returns the current X offset in the scroll.
|
inline |
Gets the curr velocity.
|
inline |
Returns how long the scroll event will take, in milliseconds.
|
inline |
Returns the start X offset in the scroll.
|
inline |
Returns whether the scroller has finished scrolling.
|
inline |
Start scrolling by providing a starting point and the distance to travel.
| startAngle | the start angle |
| dAngle | the d angle |
| duration | Duration of the scroll in milliseconds. |
|
inline |
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.
| startAngle | the start angle |
| dAngle | the d angle |
|
inline |
Returns the time elapsed since the beginning of the scrolling.
|
staticprivate |
The Constant DEFAULT_DURATION.
|
staticprivate |
The Constant FLING_MODE.
|
private |
The m coeff velocity.
|
private |
The m curr angle.
|
private |
The m deceleration.
|
private |
The m delta angle.
|
private |
The m duration.
|
private |
The m finished.
|
private |
The m mode.
|
private |
The m start angle.
|
private |
The m start time.
|
private |
The m velocity.
|
staticprivate |
The Constant SCROLL_MODE.
1.8.8