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;
}
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");
}
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");
}
use of com.reactnativenavigation.options.params.Text in project react-native-navigation by wix.
the class OptionsTest method clear_topTabOptions.
@Test
public void clear_topTabOptions() {
Options uut = new Options();
uut.topTabOptions.title = new Text("some title");
uut.clearTopTabOptions();
assertThat(uut.topTabOptions.title.hasValue()).isFalse();
}
use of com.reactnativenavigation.options.params.Text in project react-native-navigation by wix.
the class OptionsTest method mergeDoesNotMutate.
@Test
public void mergeDoesNotMutate() throws Exception {
JSONObject json1 = new JSONObject();
json1.put("topBar", createTopBar(true));
Options options1 = Options.parse(activity, mockLoader, json1);
options1.topBar.title.text = new Text("some title");
JSONObject json2 = new JSONObject();
json2.put("topBar", createTopBar(false));
Options options2 = Options.parse(activity, mockLoader, json2);
options2.topBar.title.text = new NullText();
Options merged = options1.mergeWith(options2);
assertThat(options1.topBar.visible.get()).isTrue();
assertThat(merged.topBar.visible.get()).isFalse();
assertThat(merged.topBar.title.text.get()).isEqualTo("some title");
}
Aggregations