Android Animation for Titanium
Provides access to Honeycomb+ Animation APIs
|
Provides a fluent interface to quickly and easily animate several properties of an Android View. More...
Inherits KrollProxy, and AnimatorListener.
Public Member Functions | |
.method ViewPropertyAnimator_ | setDuration (long milliseconds) |
Specify the duration of the animation. More... | |
.method long | getDuration () |
The duration of the animation. More... | |
.method long | getStartDelay () |
A delay, in milliseconds, before the animation should begin. More... | |
.method ViewPropertyAnimator_ | setStartDelay (long milliseconds) |
A delay, in milliseconds, before the animation should begin. More... | |
.method ViewPropertyAnimator_ | setInterpolator (int interpolator, Object...interpolatorValues) |
Specify which interpolator the animation should use. More... | |
.method void | start () |
Start the animation. More... | |
.method void | cancel () |
Cancel a running animation. More... | |
.method ViewPropertyAnimator_ | alpha (float value) |
Animate the alpha (opacity) of the view to the given value. More... | |
.method ViewPropertyAnimator_ | alphaBy (float value) |
Animate the alpha (opacity) of the view by the given value. More... | |
.method ViewPropertyAnimator_ | opacity (float value) |
Synonymous with alpha(float "alpha"). More... | |
.method ViewPropertyAnimator_ | opacityBy (float value) |
Synonymous with alphaBy(float "alphaBy"). More... | |
.method ViewPropertyAnimator_ | x (Object value) |
Animate the view's native "x" value to the given value. More... | |
.method ViewPropertyAnimator_ | xBy (Object value) |
Animate the view's native "x" value by the given value. More... | |
.method ViewPropertyAnimator_ | y (Object value) |
Animate the view's native "y" value to the given value. More... | |
.method ViewPropertyAnimator_ | yBy (Object value) |
Animate the view's native "y" value by the given value. More... | |
.method ViewPropertyAnimator_ | rotation (float value) |
.method ViewPropertyAnimator_ | rotationBy (float value) |
.method ViewPropertyAnimator_ | rotationX (float value) |
.method ViewPropertyAnimator_ | rotationXBy (float value) |
.method ViewPropertyAnimator_ | rotationY (float value) |
.method ViewPropertyAnimator_ | rotationYBy (float value) |
.method ViewPropertyAnimator_ | translationX (Object value) |
Animate the view's native "translationX" value to the given value. More... | |
.method ViewPropertyAnimator_ | translationXBy (Object value) |
Animate the view's native "translationX" value by the given value. More... | |
.method ViewPropertyAnimator_ | translationY (Object value) |
Animate the view's native "translationY" value to the given value. More... | |
.method ViewPropertyAnimator_ | translationYBy (Object value) |
Animate the view's native "translationY" value by the given value. More... | |
.method ViewPropertyAnimator_ | scaleX (float value) |
Animate the view's native "scaleX" value to the given value. More... | |
.method ViewPropertyAnimator_ | scaleXBy (float value) |
Animate the view's native "scaleX" value by the given value. More... | |
.method ViewPropertyAnimator_ | scaleY (float value) |
Animate the view's native "scaleY" value to the given value. More... | |
.method ViewPropertyAnimator_ | scaleYBy (float value) |
Animate the view's native "scaleY" value by the given value. More... | |
.method ViewPropertyAnimator_ | setListener (KrollFunction func) |
A function (callback) to be called when the animation starts, ends or is canceled. More... | |
.method ViewPropertyAnimator_ | withStartAction (KrollFunction function) |
.method ViewPropertyAnimator_ | withEndAction (KrollFunction function) |
Provides a fluent interface to quickly and easily animate several properties of an Android View.
When animating a view, you should attempt to use this class if possible since it is optimized (within native Android) for animating views. There will be some cases when this class won't suffice; see the ObjectAnimator documentation for some examples of when you might use it instead of this ViewPropertyAnimator
.
Here's an example of using this class to move a view down and to the right using an accelerate-decelerate interpolator. Note how you acquire an instance of this class (module.viewPropertyAnimator.animate(view)
).
// where "module" is an instance of this module and // "view" is a view you've placed on the window already. module.viewPropertyAnimator.animate(view) .setInterpolator(module.ACCELERATE_DECELERATE_INTERPOLATOR) .setDuration(3000) .xBy("100dp") .yBy("200dp");
Note also that you don't need to tell it to start. The ViewPropertyAnimator
begins its animation when the call chain is finished.
Do not create an instance using "traditional" Titanium factory methods such as module.createViewPropertyAnimator({...})
.
|
inline |
Animate the alpha (opacity) of the view to the given value.
value | The value to be animated to. |
|
inline |
Animate the alpha (opacity) of the view by the given value.
value | The value to be animated by, as an offset of the current value. |
|
inline |
Cancel a running animation.
|
inline |
The duration of the animation.
|
inline |
A delay, in milliseconds, before the animation should begin.
|
inline |
Synonymous with alpha(float "alpha").
|
inline |
Synonymous with alphaBy(float "alphaBy").
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Animate the view's native "scaleX" value to the given value.
value | The scaling factor value to animate to. A value of 1 means the true size in the layout (i.e., no scaling). |
|
inline |
Animate the view's native "scaleX" value by the given value.
value | The scaling factor value to animate by, as an offset of the current scaling factor. |
|
inline |
Animate the view's native "scaleY" value to the given value.
value | The scaling factor value to animate to. A value of 1 means the true size in the layout (i.e., no scaling). |
|
inline |
Animate the view's native "scaleY" value by the given value.
value | The scaling factor value to animate by, as an offset of the current scaling factor. |
|
inline |
Specify the duration of the animation.
Milliseconds | Number of milliseconds (seconds / 1000) over which the animation should run. |
|
inline |
Specify which interpolator the animation should use.
For an overview of interpolators, see the Android documentation.
interpolator | A value indicating which interpolator to use. The values are in constants on the main module class. |
interpolatorValues | One or more values to pass to the interpolator. Some interpolators accept values to direct/alter their calculations; the bounce interpolator is an example of such. See the Android documentation for more details. |
|
inline |
A function (callback) to be called when the animation starts, ends or is canceled.
As an alternative to this, see withStartAction and withEndAction.
func | The callback function. When called, it will be passed a single argument object, which mimics standard Titanium event listeners. The argument object's type property will be set to "start", "end" or "cancel", depending on the event provoking the callback. |
|
inline |
A delay, in milliseconds, before the animation should begin.
milliseconds | The duration of the delay, after which the animation should begin changing the view property(ies) after it has been started. |
|
inline |
Start the animation.
You probably rarely call this since the animations start automatically.
|
inline |
Animate the view's native "translationX" value to the given value.
value | The value to animate to. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "translationX" value by the given value.
value | The value to animate by as offset of the current value. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "translationY" value to the given value.
value | The value to animate to. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "translationY" value by the given value.
value | The value to animate by as offset of the current value. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
|
inline |
|
inline |
Animate the view's native "x" value to the given value.
value | The value to animate to. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "x" value by the given value.
value | The value to animate by as offset of the current value. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "y" value to the given value.
value | The value to animate to. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |
|
inline |
Animate the view's native "y" value by the given value.
value | The value to animate by as offset of the current value. You can pass a string that contains units, such as "12dp", and the calculation will be done for you. |