Search in sources :

Example 51 with Options

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

the class BottomTabPresenterTest method createTab2Options.

private Options createTab2Options() {
    Options options = new Options();
    options.bottomTabOptions.badge = new Text("tab2badge");
    options.bottomTabOptions.iconColor = new ThemeColour(new Colour(Color.RED));
    options.bottomTabOptions.selectedIconColor = new ThemeColour(new Colour(Color.RED));
    return options;
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) Colour(com.reactnativenavigation.options.params.Colour) DontApplyColour(com.reactnativenavigation.options.params.DontApplyColour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour)

Example 52 with Options

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

the class ExternalComponentViewControllerTest method beforeEach.

@Override
public void beforeEach() {
    componentCreator = spy(new FragmentCreatorMock());
    activity = newActivity();
    ec = createExternalComponent();
    reactInstanceManager = Mockito.mock(ReactInstanceManager.class);
    emitter = Mockito.mock(EventEmitter.class);
    childRegistry = new ChildControllersRegistry();
    uut = spy(new ExternalComponentViewController(activity, childRegistry, "fragmentId", new Presenter(activity, Options.EMPTY), ec, componentCreator, reactInstanceManager, emitter, new ExternalComponentPresenter(), new Options()));
}
Also used : Options(com.reactnativenavigation.options.Options) ReactInstanceManager(com.facebook.react.ReactInstanceManager) EventEmitter(com.reactnativenavigation.react.events.EventEmitter) Presenter(com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)

Example 53 with Options

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

the class ModalPresenterTest method showModal_resolvesDefaultOptions.

@Test
public void showModal_resolvesDefaultOptions() throws JSONException {
    Options defaultOptions = new Options();
    JSONObject disabledShowModalAnimation = TransitionAnimationOptionsTestKt.newModalAnimationJson(false);
    defaultOptions.animations.showModal = TransitionAnimationOptionsKt.parseTransitionAnimationOptions(disabledShowModalAnimation);
    uut.setDefaultOptions(defaultOptions);
    uut.showModal(modal1, root, new CommandListenerAdapter());
    verifyNoInteractions(animator);
}
Also used : Options(com.reactnativenavigation.options.Options) JSONObject(org.json.JSONObject) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 54 with Options

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

the class OptionHelper method createBottomTabOptions.

public static Options createBottomTabOptions() {
    Options options = new Options();
    options.topBar.buttons.left = new ArrayList<>();
    options.bottomTabOptions.text = new Text("Tab");
    options.bottomTabOptions.icon = new Text("http://127.0.0.1/icon.png");
    return options;
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text)

Example 55 with Options

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

the class BottomTabPresenterTest method mergeChildOptions_nullColorsAreNotMerged.

@Test
public void mergeChildOptions_nullColorsAreNotMerged() {
    Options options = new Options();
    options.bottomTabOptions.iconColor = new ThemeColour(new DontApplyColour());
    options.bottomTabOptions.selectedIconColor = new ThemeColour(new DontApplyColour());
    uut.mergeChildOptions(options, child3);
    verify(bottomTabs, times(0)).setIconActiveColor(anyInt(), anyInt());
    verify(bottomTabs, times(0)).setIconInactiveColor(anyInt(), anyInt());
}
Also used : Options(com.reactnativenavigation.options.Options) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) DontApplyColour(com.reactnativenavigation.options.params.DontApplyColour) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

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