Search in sources :

Example 16 with Colour

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

use of com.reactnativenavigation.options.params.Colour 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

Colour (com.reactnativenavigation.options.params.Colour)17 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)17 BaseTest (com.reactnativenavigation.BaseTest)12 Test (org.junit.Test)12 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 IconBackgroundDrawable (com.reactnativenavigation.views.stack.topbar.titlebar.IconBackgroundDrawable)4 Options (com.reactnativenavigation.options.Options)3 DontApplyColour (com.reactnativenavigation.options.params.DontApplyColour)3 NullText (com.reactnativenavigation.options.params.NullText)3 NullThemeColour (com.reactnativenavigation.options.params.NullThemeColour)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