Search in sources :

Example 6 with NullText

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

the class Options method clearOneTimeOptions.

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

Example 7 with NullText

use of com.reactnativenavigation.options.params.NullText 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));
}
Also used : Options(com.reactnativenavigation.options.Options) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) NullText(com.reactnativenavigation.options.params.NullText) AHNotification(com.aurelhubert.ahbottomnavigation.notification.AHNotification) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

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