From 99960b73e986409f61c5b5d05aa04dea3105a663 Mon Sep 17 00:00:00 2001
From: Scott Main The property animation system lets you declare property animations with XML instead of doing
- it programmatically. The following Android classes have XML declaration support with the
+ it programmatically. By defining your animations in XML, you can easily reuse your animations
+in multiple activities and more easily edit the animation sequence. To distinguish animation files that use the new property animation APIs from those that use the
+legacy view animation framework,
+starting with Android 3.1, you should save the XML files for property animations in the {@code
+res/animator/} directory (instead of {@code res/anim/}). Using the {@code animator} directory name
+is optional, but necessary if you want to use the layout editor tools in the Eclipse ADT plugin (ADT
+11.0.0+), because ADT only searches the {@code res/animator/} directory for property animation
+resources. The following property animation classes have XML declaration support with the
following XML tags: The The The The You can specify nested You can specify nested As an example, this XML code creates an {@link android.animation.AnimatorSet} object that
@@ -969,4 +984,9 @@ For more information on creating animators, see the sections on animating with
android.animation.AnimatorSet} object, and then set the target objects for all of the animations
before starting the animation set. Calling {@link android.animation.AnimatorSet#setTarget
setTarget()} sets a single target object for all children of the {@link
- android.animation.AnimatorSet}.Declaring Animations in XML
+
+Declaring Animations in XML
@@ -924,22 +936,25 @@ For more information on creating animators, see the sections on animating with
beginning each time.
-
objectAnimator ({@link android.animation.ObjectAnimator}) element has the
- additional attribute propertyName, that lets you specify the name of the property
- being animated. The objectAnimator element does not expose a target
+ <objectAnimator> ({@link android.animation.ObjectAnimator}) element has the
+ additional attribute android:propertyName, that lets you specify the name of the
+property
+ being animated. The <objectAnimator> element does not expose a target
attribute, however, so you cannot set the object to animate in the XML declaration. You have to
inflate the XML resource by calling {@link android.animation.AnimatorInflater#loadAnimator
loadAnimator()} and call {@link android.animation.ObjectAnimator#setTarget setTarget()} to set
the target object unlike the underlying {@link android.animation.ObjectAnimator},
before calling {@link android.animation.ObjectAnimator#start start()}.set element ({@link android.animation.AnimatorSet}) exposes a single
- attribute, ordering. Set this attribute to together (default) to play
- all the animations in this set at once. Set this attribute to sequentially to play
+ <set> element ({@link android.animation.AnimatorSet}) exposes a single
+ attribute, android:ordering. Set this attribute to "together" (default)
+to play
+ all the animations in this set at once. Set this attribute to "sequentially" to play
the animations in the order they are declared.set tags to further group animations together. The
- animations that you want to group together should be children of the set tag and can
+ <set> elements to further group animations together.
+The
+ animations that you want to group together should be children of the <set> tag and can
define their own ordering attribute.
Tip: To see how the ADT layout editor allows you to develop and +preview animations in your layout, watch the Android +Developer Tools session from Google I/O '11
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index 32595a0dd50aa..59f2e731dba5a 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -87,10 +87,19 @@ supported inside project {@code res/} directory.animator/anim/