@Test public void whenTransitionFinished() { final Screen.TransitionFinishedListener listener = mock(Screen.TransitionFinishedListener.class); screen.transitionStarted(); screen.whenTransitionFinished(listener); verify(listener, never()).onTransitionFinished(); screen.transitionFinished(); verify(listener).onTransitionFinished(); reset(listener); screen.transitionStarted(); screen.transitionFinished(); verify(listener, never()).onTransitionFinished(); }
protected final void whenTransitionFinished(TransitionFinishedListener listener) { if (isTransitioning) { transitionFinishedListeners.add(listener); } else { listener.onTransitionFinished(); } }
Screen extends LifecycleAwareComponent implements NavigableCompat, ActionBarModifier { protected final void whenTransitionFinished(TransitionFinishedListener listener) { if (isTransitioning) { transitionFinishedListeners.add(listener); } else { listener.onTransitionFinished(); } } }
Screen extends LifecycleAwareComponent implements NavigableCompat, ActionBarModifier { protected final void whenTransitionFinished(TransitionFinishedListener listener) { if (isTransitioning) { transitionFinishedListeners.add(listener); } else { listener.onTransitionFinished(); } } Screen(); }
Screen extends LifecycleAwareComponent implements NavigableCompat, ActionBarModifier { protected final void whenTransitionFinished(TransitionFinishedListener listener) { if (isTransitioning) { transitionFinishedListeners.add(listener); } else { listener.onTransitionFinished(); } } Screen(); @Nullable final V getView(); @Nullable final Activity getActivity(); @Nullable final LegacyNavigator getNavigator(); final Dialog getDialog(); @Override final void transitionStarted(); @Override final void transitionFinished(); boolean handleBack(); boolean quit(); @NotNull @Override String toString(); final void setView(@Nullable V view); final void setActivity(@Nullable Activity activity); }
Screen extends LifecycleAwareComponent implements NavigableCompat, ActionBarModifier { protected final void whenTransitionFinished(TransitionFinishedListener listener) { if (isTransitioning) { transitionFinishedListeners.add(listener); } else { listener.onTransitionFinished(); } } Screen(); @Nullable final V getView(); @Nullable final Activity getActivity(); @Nullable final LegacyNavigator getNavigator(); final Dialog getDialog(); @Override final void transitionStarted(); @Override final void transitionFinished(); boolean handleBack(); boolean quit(); @NotNull @Override String toString(); final void setView(@Nullable V view); final void setActivity(@Nullable Activity activity);  }