UiContainer extends FrameLayout implements HandleBack, TransitionListener { static ScreenTransition getTransition(ViewController viewController, TransitionDirection transitionDirection) { if (viewController == null) { return new InstantTransition(); } if (transitionDirection == TransitionDirection.ENTER) { return viewController.enterTransition(); } else { return viewController.exitTransition(); } } UiContainer(Context context);  UiContainer(Context context, AttributeSet attrs);  UiContainer(Context context, AttributeSet attrs, int defStyle); boolean onBack(); void goTo(RouteChange routeChange); @Override void onTransitionCompleted(); @Override boolean dispatchTouchEvent(MotionEvent event); @Override boolean dispatchDragEvent(DragEvent event); @Override boolean dispatchKeyEvent(KeyEvent event); @Override boolean dispatchKeyEventPreIme(KeyEvent event); @Override boolean dispatchKeyShortcutEvent(KeyEvent event); @Override boolean dispatchTrackballEvent(MotionEvent event);  }
@Test public void getTransitionsFromViewController() { final ViewControllerWithTransitions viewControllerWithTransitions = new ViewControllerWithTransitions(); final ScreenTransition enterTransition = UiContainer.getTransition(viewControllerWithTransitions, TransitionDirection.ENTER); final ScreenTransition exitTransition = UiContainer.getTransition(viewControllerWithTransitions, TransitionDirection.EXIT); Assert.assertEquals(enterTransition.getClass(), ForwardSlideTransition.class); Assert.assertEquals(exitTransition.getClass(), BackwardSlideTransition.class); }
@Test public void useInstantTransitionIfControllerHasNoTransitions() { final ViewController viewControllerWithoutTransitions = new ViewControllerWithoutTransitions(); final ScreenTransition enterTransition = UiContainer.getTransition(viewControllerWithoutTransitions, TransitionDirection.ENTER); final ScreenTransition exitTransition = UiContainer.getTransition(viewControllerWithoutTransitions, TransitionDirection.EXIT); Assert.assertEquals(enterTransition.getClass(), InstantTransition.class); Assert.assertEquals(exitTransition.getClass(), InstantTransition.class); }