Search in sources :

Example 36 with Bool

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

the class OverlayTouchDelegateTest method onlyDownEventIsHandled.

@Test
public void onlyDownEventIsHandled() {
    uut.setInterceptTouchOutside(new Bool(true));
    uut.onInterceptTouchEvent(upEvent);
    verify(uut, times(0)).handleDown(upEvent);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 37 with Bool

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

the class OverlayTouchDelegateTest method downEventIsHandled.

@Test
public void downEventIsHandled() {
    uut.setInterceptTouchOutside(new Bool(true));
    uut.onInterceptTouchEvent(downEvent);
    verify(uut, times(1)).handleDown(downEvent);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 38 with Bool

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

the class OptionsApplyingTest method appliesTopBarVisible.

@Test
public void appliesTopBarVisible() {
    stack.push(uut, new CommandListenerAdapter());
    assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
    initialNavigationOptions.topBar.title.text = new Text("the title");
    assertThat(stack.getTopBar().getVisibility()).isNotEqualTo(View.GONE);
    Options opts = new Options();
    opts.topBar.visible = new Bool(false);
    opts.topBar.animate = new Bool(false);
    uut.mergeOptions(opts);
    assertThat(stack.getTopBar().getVisibility()).isEqualTo(View.GONE);
}
Also used : Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) Text(com.reactnativenavigation.options.params.Text) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 39 with Bool

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

the class SideMenuControllerTest method closeDrawerAndAssertVisibility.

private void closeDrawerAndAssertVisibility(ViewController<?> side, Functions.FuncR1<ViewController<?>, SideMenuOptions> opt) {
    Options options = new Options();
    (side == left ? options.sideMenuRootOptions.left : options.sideMenuRootOptions.right).visible = new Bool(false);
    uut.mergeOptions(options);
    assertThat(uut.getView().isDrawerOpen(getGravity(side))).isFalse();
    assertThat(opt.run(side).visible.isTrue()).isFalse();
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool)

Example 40 with Bool

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

the class SideMenuControllerTest method openDrawerAndAssertVisibility.

private void openDrawerAndAssertVisibility(ViewController<?> side, Functions.FuncR1<ViewController<?>, SideMenuOptions> opt) {
    Options options = new Options();
    (side == left ? options.sideMenuRootOptions.left : options.sideMenuRootOptions.right).visible = new Bool(true);
    uut.mergeOptions(options);
    assertThat(uut.getView().isDrawerOpen(getGravity(side))).isTrue();
    assertThat(opt.run(side).visible.isFalseOrUndefined()).isTrue();
}
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