@Test public void testEndTransitions() throws Throwable { final ViewGroup root = rule.getActivity().getRoot(); final Transition transition = new AutoTransition(); transition.setDuration(30000); final Transition.TransitionListener listener = mock(Transition.TransitionListener.class); transition.addListener(listener); rule.runOnUiThread(new Runnable() { @Override public void run() { TransitionManager.go(mScenes[0], transition); } }); verify(listener, timeout(3000)).onTransitionStart(any(Transition.class)); rule.runOnUiThread(new Runnable() { @Override public void run() { TransitionManager.endTransitions(root); } }); verify(listener, timeout(3000)).onTransitionEnd(any(Transition.class)); }
public static void endTransitions(final ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot); if (runningTransitions != null && !runningTransitions.isEmpty()) { ArrayList<Transition> copy = new ArrayList<>(runningTransitions); for (int i = copy.size() - 1; i >= 0; i--) { final Transition transition = copy.get(i); transition.forceToEnd(sceneRoot); } } }
TransitionManager { public static void endTransitions(final ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot); if (runningTransitions != null && !runningTransitions.isEmpty()) { ArrayList<Transition> copy = new ArrayList<>(runningTransitions); for (int i = copy.size() - 1; i >= 0; i--) { final Transition transition = copy.get(i); transition.forceToEnd(sceneRoot); } } } }
TransitionManager { public static void endTransitions(final ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot); if (runningTransitions != null && !runningTransitions.isEmpty()) { ArrayList<Transition> copy = new ArrayList<>(runningTransitions); for (int i = copy.size() - 1; i >= 0; i--) { final Transition transition = copy.get(i); transition.forceToEnd(sceneRoot); } } }  }
TransitionManager { public static void endTransitions(final ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot); if (runningTransitions != null && !runningTransitions.isEmpty()) { ArrayList<Transition> copy = new ArrayList<>(runningTransitions); for (int i = copy.size() - 1; i >= 0; i--) { final Transition transition = copy.get(i); transition.forceToEnd(sceneRoot); } } }  void setTransition(@NonNull Scene scene, @Nullable Transition transition); void setTransition(@NonNull Scene fromScene, @NonNull Scene toScene,
            @Nullable Transition transition); void transitionTo(@NonNull Scene scene); static void go(@NonNull Scene scene); static void go(@NonNull Scene scene, @Nullable Transition transition); static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot); static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot,
            @Nullable Transition transition); static void endTransitions(final ViewGroup sceneRoot); }
TransitionManager { public static void endTransitions(final ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot); if (runningTransitions != null && !runningTransitions.isEmpty()) { ArrayList<Transition> copy = new ArrayList<>(runningTransitions); for (int i = copy.size() - 1; i >= 0; i--) { final Transition transition = copy.get(i); transition.forceToEnd(sceneRoot); } } }  void setTransition(@NonNull Scene scene, @Nullable Transition transition); void setTransition(@NonNull Scene fromScene, @NonNull Scene toScene,
            @Nullable Transition transition); void transitionTo(@NonNull Scene scene); static void go(@NonNull Scene scene); static void go(@NonNull Scene scene, @Nullable Transition transition); static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot); static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot,
            @Nullable Transition transition); static void endTransitions(final ViewGroup sceneRoot);  }