Search in sources :

Example 16 with Text

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

the class TitleBarButtonControllerTest method createComponentButton.

private ButtonOptions createComponentButton() {
    ButtonOptions componentButton = new ButtonOptions();
    componentButton.id = "customBtn";
    componentButton.component.name = new Text("com.rnn.customBtn");
    componentButton.component.componentId = new Text("component4");
    return componentButton;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Text(com.reactnativenavigation.options.params.Text)

Example 17 with Text

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

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

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

the class BottomTabPresenterTest method createTab1Options.

private Options createTab1Options() {
    Options options = new Options();
    options.bottomTabOptions.badge = new Text("tab1badge");
    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 20 with Text

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

the class ParentControllerTest method mergeOptions_optionsAreMergedWhenChildAppears.

@Test
public void mergeOptions_optionsAreMergedWhenChildAppears() {
    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();
    ArgumentCaptor<Options> optionsCaptor = ArgumentCaptor.forClass(Options.class);
    verify(uut, times(1)).clearOptions();
    verify(uut, times(1)).applyChildOptions(optionsCaptor.capture(), eq(child1));
    assertThat(optionsCaptor.getValue().topBar.title.text.get()).isEqualTo("new 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)

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