Search in sources :

Example 1 with NullText

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

the class ComponentOptions method reset.

public void reset() {
    name = new NullText();
    componentId = new NullText();
    alignment = Alignment.Default;
    waitForRender = new NullBool();
    width = new NullNumber();
    height = new NullNumber();
}
Also used : NullBool(com.reactnativenavigation.options.params.NullBool) NullNumber(com.reactnativenavigation.options.params.NullNumber) NullText(com.reactnativenavigation.options.params.NullText)

Example 2 with NullText

use of com.reactnativenavigation.options.params.NullText 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");
}
Also used : JSONObject(org.json.JSONObject) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) NullText(com.reactnativenavigation.options.params.NullText) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 3 with NullText

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

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

the class TopBarOptions method validate.

public void validate() {
    if (title.component.hasValue() && (title.text.hasValue() || subtitle.text.hasValue())) {
        if (BuildConfig.DEBUG)
            Log.w("RNN", "A screen can't use both text and component - clearing text.");
        title.text = new NullText();
        subtitle.text = new NullText();
    }
}
Also used : NullText(com.reactnativenavigation.options.params.NullText)

Example 5 with NullText

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

the class BottomTabsOptions method clearOneTimeOptions.

public void clearOneTimeOptions() {
    currentTabId = new NullText();
    currentTabIndex = new NullNumber();
}
Also used : NullNumber(com.reactnativenavigation.options.params.NullNumber) NullText(com.reactnativenavigation.options.params.NullText)

Aggregations

NullText (com.reactnativenavigation.options.params.NullText)7 NullNumber (com.reactnativenavigation.options.params.NullNumber)3 Text (com.reactnativenavigation.options.params.Text)3 BaseTest (com.reactnativenavigation.BaseTest)2 Test (org.junit.Test)2 AHNotification (com.aurelhubert.ahbottomnavigation.notification.AHNotification)1 Options (com.reactnativenavigation.options.Options)1 Bool (com.reactnativenavigation.options.params.Bool)1 Colour (com.reactnativenavigation.options.params.Colour)1 NullBool (com.reactnativenavigation.options.params.NullBool)1 NullThemeColour (com.reactnativenavigation.options.params.NullThemeColour)1 Number (com.reactnativenavigation.options.params.Number)1 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)1 JSONObject (org.json.JSONObject)1