use of com.reactnativenavigation.options.params.Text in project react-native-navigation by wix.
the class TitleBarHelper method reactViewButton.
public static ButtonOptions reactViewButton(String name) {
ButtonOptions button = new ButtonOptions();
button.id = name + CompatUtils.generateViewId();
button.component = new ComponentOptions();
button.component.name = new Text("com.example" + name + CompatUtils.generateViewId());
button.component.componentId = new Text(name + CompatUtils.generateViewId());
return button;
}
use of com.reactnativenavigation.options.params.Text in project react-native-navigation by wix.
the class OptionsApplyingTest method initialOptionsAppliedOnAppear.
@Test
public void initialOptionsAppliedOnAppear() {
uut.options.topBar.title.text = new Text("the title");
StackController stackController = TestUtils.newStackController(activity).build();
stackController.ensureViewIsCreated();
stackController.push(uut, new CommandListenerAdapter());
assertThat(stackController.getTopBar().getTitle()).isEmpty();
uut.onViewWillAppear();
assertThat(stackController.getTopBar().getTitle()).isEqualTo("the title");
}
use of com.reactnativenavigation.options.params.Text 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);
}
use of com.reactnativenavigation.options.params.Text in project react-native-navigation by wix.
the class BottomTabPresenterTest method applyOptions_shouldPresentBadgeIfAvailable.
@Test
public void applyOptions_shouldPresentBadgeIfAvailable() {
final Options tab1 = tab1Options.copy();
tab1.bottomTabOptions.badge = new NullText();
tab1.bottomTabOptions.badgeColor = new NullThemeColour();
final Options tab2 = tab2Options.copy();
tab2.bottomTabOptions.badge = new Text("Badge");
tab2.bottomTabOptions.badgeColor = ThemeColour.of(Color.RED);
createBottomTabs(tab1, tab2, new Options());
uut.applyOptions();
ArgumentCaptor<AHNotification> notificationArgumentCaptor = ArgumentCaptor.forClass(AHNotification.class);
verify(bottomTabs).setNotification(notificationArgumentCaptor.capture(), eq(1));
final AHNotification value = notificationArgumentCaptor.getValue();
assertThat(value.getReadableText()).isEqualTo("Badge");
assertThat(value.getBackgroundColor()).isEqualTo(Color.RED);
verify(bottomTabs, never()).setNotification(notificationArgumentCaptor.capture(), eq(0));
verify(bottomTabs, never()).setNotification(notificationArgumentCaptor.capture(), eq(2));
}
Aggregations