Search in sources :

Example 1 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class NavigatorTest method destroy_destroyedRoot.

@Test
public void destroy_destroyedRoot() {
    disablePushAnimation(child1);
    StackController spy = spy(parentController);
    spy.options.animations.setRoot.getEnter().enabled = new Bool(false);
    uut.setRoot(spy, new CommandListenerAdapter(), reactInstanceManager);
    spy.push(child1, new CommandListenerAdapter());
    activityController.destroy();
    verify(spy, times(1)).destroy();
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) StackController(com.reactnativenavigation.viewcontrollers.stack.StackController) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 2 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class SideMenuControllerTest method openLeftMenu.

private void openLeftMenu() {
    Options options = new Options();
    options.sideMenuRootOptions.left.visible = new Bool(true);
    options.sideMenuRootOptions.left.animate = new Bool(false);
    uut.mergeOptions(options);
    uut.onDrawerSlide(left.getView(), 1);
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool)

Example 3 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class SideMenuControllerTest method mergeChildOptions_lockModeIsUpdatedInInitialOptions.

@Test
public void mergeChildOptions_lockModeIsUpdatedInInitialOptions() {
    setLeftRight(left, right);
    Options leftDisabled = new Options();
    leftDisabled.sideMenuRootOptions.left.enabled = new Bool(false);
    left.mergeOptions(leftDisabled);
    assertThat(uut.resolveCurrentOptions().sideMenuRootOptions.left.enabled.get()).isFalse();
    Options rightVisible = new Options();
    rightVisible.sideMenuRootOptions.right.visible = new Bool(true);
    right.mergeOptions(rightVisible);
    assertThat(uut.resolveCurrentOptions().sideMenuRootOptions.left.enabled.get()).isFalse();
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 4 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class SideMenuControllerTest method createSideMenuOptions.

@NotNull
private Options createSideMenuOptions() {
    Options options = new Options();
    options.sideMenuRootOptions.left.animate = new Bool(false);
    options.sideMenuRootOptions.right.animate = new Bool(false);
    return options;
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class SideMenuControllerTest method openRightMenu.

private void openRightMenu() {
    Options options = new Options();
    options.sideMenuRootOptions.right.visible = new Bool(true);
    options.sideMenuRootOptions.right.animate = new Bool(false);
    uut.mergeOptions(options);
    uut.onDrawerSlide(right.getView(), 1);
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool)

Aggregations

Bool (com.reactnativenavigation.options.params.Bool)40 BaseTest (com.reactnativenavigation.BaseTest)29 Test (org.junit.Test)29 Options (com.reactnativenavigation.options.Options)14 SideMenuOptions (com.reactnativenavigation.options.SideMenuOptions)10 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)7 Colour (com.reactnativenavigation.options.params.Colour)6 Text (com.reactnativenavigation.options.params.Text)6 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)6 MenuItem (android.view.MenuItem)5 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)4 Drawable (android.graphics.drawable.Drawable)4 NullBool (com.reactnativenavigation.options.params.NullBool)4 IconBackgroundDrawable (com.reactnativenavigation.views.stack.topbar.titlebar.IconBackgroundDrawable)4 ViewGroup (android.view.ViewGroup)3 StackController (com.reactnativenavigation.viewcontrollers.stack.StackController)3 SimpleComponentViewController (com.reactnativenavigation.mocks.SimpleComponentViewController)2 IconBackgroundOptions (com.reactnativenavigation.options.IconBackgroundOptions)2 View (android.view.View)1 FrameLayout (android.widget.FrameLayout)1