Fix endTransition index out of bounds exception.

Bug 22063111

When transition.end() is run, it removes itself from
the list of running transitions and perturbs the list.

Change-Id: I4feb7ebe19717a0e2302844d4e4e0d19a55ec57c
This commit is contained in:
George Mount
2015-06-24 11:09:47 -07:00
parent 82e595fd6e
commit 800320933e

View File

@@ -435,10 +435,11 @@ public class TransitionManager {
sPendingTransitions.remove(sceneRoot);
final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot);
if (runningTransitions != null) {
final int count = runningTransitions.size();
for (int i = 0; i < count; i++) {
final Transition transition = runningTransitions.get(i);
if (runningTransitions != null && !runningTransitions.isEmpty()) {
// Make a copy in case this is called by an onTransitionEnd listener
ArrayList<Transition> copy = new ArrayList(runningTransitions);
for (int i = copy.size() - 1; i >= 0; i--) {
final Transition transition = copy.get(i);
transition.end();
}
}