Search in sources :

Example 21 with Bool

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

the class ComponentViewControllerTest method getTopInset_drawBehind_defaultOptions.

@Test
public void getTopInset_drawBehind_defaultOptions() {
    Options defaultOptions = new Options();
    defaultOptions.statusBar.drawBehind = new Bool(true);
    uut.setDefaultOptions(defaultOptions);
    uut.options.topBar.drawBehind = new Bool(true);
    Java6Assertions.assertThat(uut.getTopInset()).isEqualTo(0);
}
Also used : Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 22 with Bool

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

the class ComponentViewControllerTest method getTopInset_drawBehind.

@Test
public void getTopInset_drawBehind() {
    uut.options.statusBar.drawBehind = new Bool(true);
    uut.options.topBar.drawBehind = new Bool(true);
    Java6Assertions.assertThat(uut.getTopInset()).isEqualTo(0);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 23 with Bool

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

the class SideMenuControllerTest method closeLeftMenu.

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

Example 24 with Bool

use of com.reactnativenavigation.options.params.Bool 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 25 with Bool

use of com.reactnativenavigation.options.params.Bool 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)

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