ObjectAnimator

ObjectAnimator component is used to animate widgets.

Example

Rotating an image to create a loading icon.

example



Blocks

set target

Set the view to animate.

set target

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
ViewView to animateYes

set property

Set the property to animate.

set property

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
PropertyProperties: rotation, translationX, translationY, alpha, scaleX, scaleYYes

set value

Set the value to animate to.

set value

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
NumberValue to animate toNo

set values from to

Set the value to animate from and to.

set values from to

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
NumberValue to animate fromNo
NumberValue to animate toNo

set duration

Set the duration for the animation.

set duration

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
NumberDuration of the animationNo

set repeat mode

Two different repeat modes:

  1. RESTART - restarts the animation from beginning again when it is finished.
  2. REVERSE - restarts the animation from end to beginning when it is finished.

set repeat mode

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
Repeat ModeModes: RESTART, REVERSEYes

set repeat count

Set the number of times the animation should repeat.

set repeat count

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
NumberNumber of times to repeat the animationNo

set interpolator

Set the interpolator for the animation, which affects the way animation behaves.

set interpolator

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes
InterpolatorInterpolators: Linear, Accelerate, Decelerate, AccelerateDecelerate, BounceYes

start

Start the animation.

start

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes

cancel

Cancel the animation.

cancel

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes

is running

True if animation is currently running.

is running

TYPEEXPLANATIONREQUIRED
ObjectAnimatorObjectAnimator ComponentYes

Events

onAnimationStart

Triggered when animation starts.

onAnimationEnd

Triggered when animation finishes.

onAnimationCancel

Triggered when animation is cancelled.