Search in sources :

Example 11 with Text

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

the class TitleBarReactViewControllerTest method createComponent.

private ComponentOptions createComponent() {
    ComponentOptions component = new ComponentOptions();
    component.componentId = new Text("compId");
    component.name = new Text("compName");
    return component;
}
Also used : ComponentOptions(com.reactnativenavigation.options.ComponentOptions) Text(com.reactnativenavigation.options.params.Text)

Example 12 with Text

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

the class ParentControllerTest method mergeOptions_initialParentOptionsAreNotMutatedWhenChildAppears.

@Test
public void mergeOptions_initialParentOptionsAreNotMutatedWhenChildAppears() {
    Options options = new Options();
    options.topBar.title.text = new Text("new title");
    ViewController<?> child1 = spy(new SimpleViewController(activity, childRegistry, "child1", options));
    children.add(child1);
    uut.ensureViewIsCreated();
    child1.ensureViewIsCreated();
    child1.onViewWillAppear();
    assertThat(uut.initialOptions.topBar.title.text.get()).isEqualTo(INITIAL_TITLE);
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 13 with Text

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

the class TopBarButtonControllerTest method setIconButton.

private void setIconButton(boolean enabled) {
    button.id = "btn1";
    button.icon = new Text("someIcon");
    button.color = new ThemeColour(new Colour(Color.RED), new Colour(Color.RED));
    button.component.name = new NullText();
    button.component.componentId = new NullText();
    button.enabled = new Bool(enabled);
    button.showAsAction = new Number(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
Also used : Number(com.reactnativenavigation.options.params.Number) Bool(com.reactnativenavigation.options.params.Bool) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) NullText(com.reactnativenavigation.options.params.NullText) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour)

Example 14 with Text

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

the class SideMenuControllerTest method resolveCurrentOptions_centerOptionsAreMergedEvenIfDrawerIsOpen.

@Test
public void resolveCurrentOptions_centerOptionsAreMergedEvenIfDrawerIsOpen() {
    uut.setLeftController(left);
    center.options.topBar.title.text = new Text("Center");
    assertThat(uut.resolveCurrentOptions().topBar.title.text.hasValue()).isTrue();
    openLeftMenu();
    assertThat(uut.resolveCurrentOptions().topBar.title.text.hasValue()).isTrue();
}
Also used : Text(com.reactnativenavigation.options.params.Text) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 15 with Text

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

Text (com.reactnativenavigation.options.params.Text)34 BaseTest (com.reactnativenavigation.BaseTest)16 Test (org.junit.Test)16 Options (com.reactnativenavigation.options.Options)14 Colour (com.reactnativenavigation.options.params.Colour)8 NullText (com.reactnativenavigation.options.params.NullText)8 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)8 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)6 Bool (com.reactnativenavigation.options.params.Bool)6 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)4 Drawable (android.graphics.drawable.Drawable)4 MenuItem (android.view.MenuItem)4 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)4 IconBackgroundDrawable (com.reactnativenavigation.views.stack.topbar.titlebar.IconBackgroundDrawable)4 NonNull (androidx.annotation.NonNull)3 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)3 ComponentOptions (com.reactnativenavigation.options.ComponentOptions)3 NullThemeColour (com.reactnativenavigation.options.params.NullThemeColour)3 FabOptions (com.reactnativenavigation.options.FabOptions)2 IconBackgroundOptions (com.reactnativenavigation.options.IconBackgroundOptions)2