Search in sources :

Example 1 with Text

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

the class TitleBarHelper method titleComponent.

public static ComponentOptions titleComponent(String componentId) {
    ComponentOptions component = new ComponentOptions();
    component.componentId = new Text(componentId);
    component.name = new Text(componentId);
    return component;
}
Also used : ComponentOptions(com.reactnativenavigation.options.ComponentOptions) Text(com.reactnativenavigation.options.params.Text)

Example 2 with Text

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

the class TitleBarHelper method iconButton.

public static ButtonOptions iconButton(String id, String icon) {
    ButtonOptions button = new ButtonOptions();
    button.id = "someButton";
    button.icon = new Text(icon);
    return button;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Text(com.reactnativenavigation.options.params.Text)

Example 3 with Text

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

the class OptionsApplyingTest method reappliesOptionsOnMerge.

@Test
public void reappliesOptionsOnMerge() {
    assertThat(stack.getTopBar().getTitle()).isEmpty();
    stack.push(uut, new CommandListenerAdapter());
    Options opts = new Options();
    opts.topBar.title.text = new Text("the new title");
    uut.mergeOptions(opts);
    assertThat(stack.getTopBar().getTitle()).isEqualTo("the new title");
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 4 with Text

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

the class OptionsApplyingTest method mergeNavigationOptionsUpdatesCurrentOptions.

@Test
public void mergeNavigationOptionsUpdatesCurrentOptions() {
    assertThat(uut.options.topBar.title.text.get("")).isEmpty();
    Options options = new Options();
    options.topBar.title.text = new Text("new title");
    uut.mergeOptions(options);
    assertThat(uut.options.topBar.title.text.get()).isEqualTo("new title");
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 5 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)

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