UI Animation
- View Animation
- View animation does simple tweened transformations (position, size, rotation, etc.) on
a View.
- Implemented in the android.view.animation package.
- Animations are specified in XML in the res/anim directory
- Supports animation of scaling, alpha, translation, rotation, and combinations of these
as sets that are applied simultaneously.
The elements of a set can be done together (default) or in sequence, as specified by
the ordering tag.
But the sequentially option doesn't work, so use startOffset to
delay the start of an animation in a set.
- Animations are inflated into an Animation object, which is applied to the image.
- Transformations are applied according to an interpolator.
- Watch what's happening by implementing the Animation.AnimationListener
interface.
- Drawable Animation
- Drawable animation loads a series of images.
- Implemented in the AnimationDrawable class.
- The frame drawables and their durations are specified in XML in an
animation-lists in the drawable directory, which is inflated into
the background of an image (remove the foreground image).
- The background animation is started, and can be repeated.
- Example
UIAnimation.java
activity_main.xml
strings.xml
image_scale.xml
image_alpha.xml
image_translate.xml
image_rotate.xml
image_combine.xml
image_frames.xml