diff options
| author | George Mount <mount@google.com> | 2014-08-18 16:24:21 -0700 |
|---|---|---|
| committer | George Mount <mount@google.com> | 2014-08-19 16:43:06 +0000 |
| commit | 7f15164ecb4c93cbb3cc886a3028621c0d0fffcc (patch) | |
| tree | ea32b563187d994305d63493d124706aaacad6a2 /core/java/android/transition/TransitionSet.java | |
| parent | fc12e6f1da309a889e529adabf5082ba52ed1db4 (diff) | |
Add a way to get Transitions from a TransitionSet.
Bug 17113732
Change-Id: I0a157a59448e66560ba2252709971131c5dea401
Diffstat (limited to 'core/java/android/transition/TransitionSet.java')
| -rw-r--r-- | core/java/android/transition/TransitionSet.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/java/android/transition/TransitionSet.java b/core/java/android/transition/TransitionSet.java index 83c60af60880..68af2d1686e9 100644 --- a/core/java/android/transition/TransitionSet.java +++ b/core/java/android/transition/TransitionSet.java @@ -151,6 +151,31 @@ public class TransitionSet extends Transition { } /** + * Returns the number of child transitions in the TransitionSet. + * + * @return The number of child transitions in the TransitionSet. + * @see #addTransition(Transition) + * @see #getTransitionAt(int) + */ + public int getTransitionCount() { + return mTransitions.size(); + } + + /** + * Returns the child Transition at the specified position in the TransitionSet. + * + * @param index The position of the Transition to retrieve. + * @see #addTransition(Transition) + * @see #getTransitionCount() + */ + public Transition getTransitionAt(int index) { + if (index < 0 || index >= mTransitions.size()) { + return null; + } + return mTransitions.get(index); + } + + /** * Setting a non-negative duration on a TransitionSet causes all of the child * transitions (current and future) to inherit this duration. * |
