Search in sources :

Example 16 with ThemeColour

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

the class NavigationIconResolverTest method iconButton.

private ButtonOptions iconButton() {
    ButtonOptions button = new ButtonOptions();
    button.id = "iconBtnId";
    button.icon = new Text(ICON_URI);
    button.color = new ThemeColour(new Colour(Color.RED));
    return button;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Text(com.reactnativenavigation.options.params.Text) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour)

Example 17 with ThemeColour

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

the class OptionsApplyingTest method appliesTopBackBackgroundColor.

@Test
public void appliesTopBackBackgroundColor() {
    uut.options.topBar.background.color = new ThemeColour(new Colour(Color.RED));
    stack.push(uut, new CommandListenerAdapter());
    idleMainLooper();
    assertThat(((ColorDrawable) stack.getTopBar().getBackground()).getColor()).isEqualTo(Color.RED);
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 18 with ThemeColour

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

the class BottomTabPresenterTest method mergeOptions_createTabsOnce.

@Test
public void mergeOptions_createTabsOnce() {
    Options options = new Options();
    options.bottomTabOptions.iconColor = new ThemeColour(new Colour(1));
    options.bottomTabOptions.selectedIconColor = new ThemeColour(new Colour(1));
    BottomTabPresenter spy = spy(uut);
    spy.mergeOptions(options);
    InOrder inOrder = inOrder(spy, child1, child2, child3, bottomTabs);
    inOrder.verify(bottomTabs).disableItemsCreation();
    forEach(tabs, tab -> inOrder.verify(spy).mergeChildOptions(options, tab));
    inOrder.verify(bottomTabs).enableItemsCreation();
}
Also used : Options(com.reactnativenavigation.options.Options) InOrder(org.mockito.InOrder) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) NullThemeColour(com.reactnativenavigation.options.params.NullThemeColour) Colour(com.reactnativenavigation.options.params.Colour) DontApplyColour(com.reactnativenavigation.options.params.DontApplyColour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

ThemeColour (com.reactnativenavigation.options.params.ThemeColour)18 Colour (com.reactnativenavigation.options.params.Colour)17 BaseTest (com.reactnativenavigation.BaseTest)13 Test (org.junit.Test)13 Text (com.reactnativenavigation.options.params.Text)8 MenuItem (android.view.MenuItem)7 Bool (com.reactnativenavigation.options.params.Bool)6 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)4 Drawable (android.graphics.drawable.Drawable)4 Options (com.reactnativenavigation.options.Options)4 DontApplyColour (com.reactnativenavigation.options.params.DontApplyColour)4 NullThemeColour (com.reactnativenavigation.options.params.NullThemeColour)4 IconBackgroundDrawable (com.reactnativenavigation.views.stack.topbar.titlebar.IconBackgroundDrawable)4 NullText (com.reactnativenavigation.options.params.NullText)3 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)2 IconBackgroundOptions (com.reactnativenavigation.options.IconBackgroundOptions)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Number (com.reactnativenavigation.options.params.Number)1 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)1 NotNull (org.jetbrains.annotations.NotNull)1