Search in sources :

Example 46 with Options

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

the class SideMenuControllerTest method mergeOptions_openRightSideMenu.

@Test
public void mergeOptions_openRightSideMenu() {
    uut.setRightController(new SimpleComponentViewController(activity, childRegistry, "right", new Options()));
    Options options = new Options();
    options.sideMenuRootOptions.right.visible = new Bool(true);
    assertThat(uut.getView().isDrawerOpen(Gravity.RIGHT)).isFalse();
    uut.mergeOptions(options);
    assertThat(uut.getView().isDrawerOpen(Gravity.RIGHT)).isTrue();
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) SimpleComponentViewController(com.reactnativenavigation.mocks.SimpleComponentViewController) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 47 with Options

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

the class SideMenuControllerTest method mergeOptions_openLeftSideMenu.

@Test
public void mergeOptions_openLeftSideMenu() {
    uut.setLeftController(new SimpleComponentViewController(activity, childRegistry, "left", new Options()));
    Options options = new Options();
    options.sideMenuRootOptions.left.visible = new Bool(true);
    assertThat(uut.getView().isDrawerOpen(Gravity.LEFT)).isFalse();
    uut.mergeOptions(options);
    assertThat(uut.getView().isDrawerOpen(Gravity.LEFT)).isTrue();
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) SimpleComponentViewController(com.reactnativenavigation.mocks.SimpleComponentViewController) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 48 with Options

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

the class SideMenuControllerTest method closeRightMenu.

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

Example 49 with Options

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

the class FloatingActionButtonTest method beforeEach.

@Override
public void beforeEach() {
    super.beforeEach();
    activity = newActivity();
    childRegistry = new ChildControllersRegistry();
    stackController = TestUtils.newStackController(activity).setFabPresenter(createFabPresenter()).build();
    stackController.ensureViewIsCreated();
    Options options = getOptionsWithFab();
    childFab = new SimpleViewController(activity, childRegistry, "child1", options);
    childNoFab = new SimpleViewController(activity, childRegistry, "child2", new Options());
}
Also used : FabOptions(com.reactnativenavigation.options.FabOptions) Options(com.reactnativenavigation.options.Options) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController)

Example 50 with Options

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

the class FloatingActionButtonTest method getOptionsWithFab.

@NonNull
private Options getOptionsWithFab() {
    Options options = new Options();
    FabOptions fabOptions = new FabOptions();
    fabOptions.id = new Text("FAB");
    options.fabOptions = fabOptions;
    return options;
}
Also used : FabOptions(com.reactnativenavigation.options.FabOptions) Options(com.reactnativenavigation.options.Options) FabOptions(com.reactnativenavigation.options.FabOptions) Text(com.reactnativenavigation.options.params.Text) NonNull(androidx.annotation.NonNull)

Aggregations

Options (com.reactnativenavigation.options.Options)110 BaseTest (com.reactnativenavigation.BaseTest)57 Test (org.junit.Test)57 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)32 SideMenuOptions (com.reactnativenavigation.options.SideMenuOptions)19 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)18 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)16 Bool (com.reactnativenavigation.options.params.Bool)15 Text (com.reactnativenavigation.options.params.Text)15 OrientationOptions (com.reactnativenavigation.options.OrientationOptions)10 AnimationOptions (com.reactnativenavigation.options.AnimationOptions)9 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)9 FrameLayout (android.widget.FrameLayout)8 SimpleComponentViewController (com.reactnativenavigation.mocks.SimpleComponentViewController)8 Presenter (com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter)8 ComponentOptions (com.reactnativenavigation.options.ComponentOptions)6 TopBarOptions (com.reactnativenavigation.options.TopBarOptions)6 TopTabOptions (com.reactnativenavigation.options.TopTabOptions)6 TopTabsOptions (com.reactnativenavigation.options.TopTabsOptions)6 Activity (android.app.Activity)5