| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
Public 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.view.carousel.Rotator类 参考

## 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.

## 构造及析构函数说明

com.ab.view.carousel.Rotator.Rotator | ( | Context | context | ) |
| inline

Create a Scroller with the specified interpolator. If the interpolator is null, the default (viscous) interpolator will be used.

参数

  context | the context

## 成员函数说明

void com.ab.view.carousel.Rotator.abortAnimation | ( |  | ) |
| inline

Stops the animation. Contrary to forceFinished(boolean), aborting the animating cause the scroller to move to the final x and y position

参见
  forceFinished(boolean)

boolean com.ab.view.carousel.Rotator.computeAngleOffset | ( |  | ) |
| 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.

返回
  true, if successful

void com.ab.view.carousel.Rotator.extendDuration | ( | int | extend | ) |
| 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.

参见
  #setFinalX(int)
  #setFinalY(int)

void com.ab.view.carousel.Rotator.fling | ( | float | velocityAngle | ) |
| 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.

final void com.ab.view.carousel.Rotator.forceFinished | ( | boolean | finished | ) |
| inline

Force the finished field to a particular value.

参数

  finished | The new finished value.

final float com.ab.view.carousel.Rotator.getCurrAngle | ( |  | ) |
| inline

Returns the current X offset in the scroll.

返回
  The new X offset as an absolute distance from the origin.

float com.ab.view.carousel.Rotator.getCurrVelocity | ( |  | ) |
| inline

Gets the curr velocity.

返回
  The original velocity less the deceleration. Result may be negative. Returns the current velocity.

final long com.ab.view.carousel.Rotator.getDuration | ( |  | ) |
| inline

Returns how long the scroll event will take, in milliseconds.

返回
  The duration of the scroll in milliseconds.

final float com.ab.view.carousel.Rotator.getStartAngle | ( |  | ) |
| inline

Returns the start X offset in the scroll.

返回
  The start X offset as an absolute distance from the origin.

final boolean com.ab.view.carousel.Rotator.isFinished | ( |  | ) |
| inline

Returns whether the scroller has finished scrolling.

返回
  True if the scroller has finished scrolling, false otherwise.

void com.ab.view.carousel.Rotator.startRotate | ( | float | startAngle,
|  | float | dAngle,
|  | int | duration
| ) |  |
| 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.

void com.ab.view.carousel.Rotator.startRotate | ( | float | startAngle,
|  | float | dAngle
| ) |  |
| 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

int com.ab.view.carousel.Rotator.timePassed | ( |  | ) |
| inline

Returns the time elapsed since the beginning of the scrolling.

返回
  The elapsed time in milliseconds.

## 类成员变量说明

final int com.ab.view.carousel.Rotator.DEFAULT_DURATION = 250
| static private

The Constant DEFAULT_DURATION.

final int com.ab.view.carousel.Rotator.FLING_MODE = 1
| static private

The Constant FLING_MODE.

float com.ab.view.carousel.Rotator.mCoeffVelocity = 0.05f
| private

The m coeff velocity.

float com.ab.view.carousel.Rotator.mCurrAngle
| private

The m curr angle.

final float com.ab.view.carousel.Rotator.mDeceleration = 240.0f
| private

The m deceleration.

float com.ab.view.carousel.Rotator.mDeltaAngle
| private

The m delta angle.

long com.ab.view.carousel.Rotator.mDuration
| private

The m duration.

boolean com.ab.view.carousel.Rotator.mFinished
| private

The m finished.

int com.ab.view.carousel.Rotator.mMode
| private

The m mode.

float com.ab.view.carousel.Rotator.mStartAngle
| private

The m start angle.

long com.ab.view.carousel.Rotator.mStartTime
| private

The m start time.

float com.ab.view.carousel.Rotator.mVelocity
| private

The m velocity.

final int com.ab.view.carousel.Rotator.SCROLL_MODE = 0
| static private

The Constant SCROLL_MODE.

该类的文档由以下文件生成:

- src/com/ab/view/carousel/Rotator.java