summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chet Haase <chet@google.com> 2013-10-06 12:10:12 -0700
committer Chet Haase <chet@google.com> 2013-10-06 12:10:12 -0700
commitaafc91c05acfb2d5a95f46f27e1deb2dfaa15c32 (patch)
tree8e9965803c45f62bf48fa45822377766386cbd94
parent845d9192d7bc822f3c3dc30643d66f7d66249566 (diff)
Fix resource-loading code for TransitionSet
The inflation code in TransitionInflater was using the wrong tag ("set") for TransitionSet. This fix corrects that problem (changing it to "transitionSet") and documents the correct tag in the TransitionSet javadocs. Issue #11085279 Transitions: transition sets loaded from resources don't work Change-Id: I8aaea9f31bbe368cffcca63d4eb6a5ec06c3ce7b
-rw-r--r--core/java/android/transition/TransitionInflater.java2
-rw-r--r--core/java/android/transition/TransitionSet.java16
2 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/transition/TransitionInflater.java b/core/java/android/transition/TransitionInflater.java
index eeb6cba7c68e..4af0f51a41e2 100644
--- a/core/java/android/transition/TransitionInflater.java
+++ b/core/java/android/transition/TransitionInflater.java
@@ -169,7 +169,7 @@ public class TransitionInflater {
} else if ("recolor".equals(name)) {
transition = new Recolor();
newTransition = true;
- } else if ("set".equals(name)) {
+ } else if ("transitionSet".equals(name)) {
transition = new TransitionSet();
TypedArray a = mContext.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.TransitionSet);
diff --git a/core/java/android/transition/TransitionSet.java b/core/java/android/transition/TransitionSet.java
index 79cd8b693df2..4545e3b51fc9 100644
--- a/core/java/android/transition/TransitionSet.java
+++ b/core/java/android/transition/TransitionSet.java
@@ -30,6 +30,22 @@ import java.util.ArrayList;
* others play {@link #ORDERING_SEQUENTIAL}. For example, {@link AutoTransition}
* uses a TransitionSet to sequentially play a Fade(Fade.OUT), followed by
* a {@link ChangeBounds}, followed by a Fade(Fade.OUT) transition.
+ *
+ * <p>A TransitionSet can be described in a resource file by using the
+ * tag <code>transitionSet</code>, along with the standard
+ * attributes of {@link android.R.styleable#TransitionSet} and
+ * {@link android.R.styleable#Transition}. Child transitions of the
+ * TransitionSet object can be loaded by adding those child tags inside the
+ * enclosing <code>transitionSet</code> tag. For example, the following xml
+ * describes a TransitionSet that plays a Fade and then a ChangeBounds
+ * transition on the affected view targets:</p>
+ * <pre>
+ * &lt;transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
+ * android:ordering="sequential"&gt;
+ * &lt;fade/&gt;
+ * &lt;changeBounds/&gt;
+ * &lt;/transitionSet&gt;
+ * </pre>
*/
public class TransitionSet extends Transition {