Search in sources :

Example 11 with Colour

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

the class TopBarButtonControllerTest method setIconColor_disabledColor.

@Test
public void setIconColor_disabledColor() {
    setIconButton(false);
    button.disabledColor = new ThemeColour(new Colour(Color.BLACK), new Colour(Color.BLACK));
    uut.addToMenu(getTitleBar(), 0);
    verify(optionsPresenter).tint(any(), eq(Color.BLACK));
}
Also used : ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 12 with Colour

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

the class BottomTabPresenterTest method createTab2Options.

private Options createTab2Options() {
    Options options = new Options();
    options.bottomTabOptions.badge = new Text("tab2badge");
    options.bottomTabOptions.iconColor = new ThemeColour(new Colour(Color.RED));
    options.bottomTabOptions.selectedIconColor = new ThemeColour(new Colour(Color.RED));
    return options;
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) 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)

Example 13 with Colour

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

the class BottomTabPresenterTest method createTab1Options.

private Options createTab1Options() {
    Options options = new Options();
    options.bottomTabOptions.badge = new Text("tab1badge");
    options.bottomTabOptions.iconColor = new ThemeColour(new Colour(Color.RED));
    options.bottomTabOptions.selectedIconColor = new ThemeColour(new Colour(Color.RED));
    return options;
}
Also used : Options(com.reactnativenavigation.options.Options) Text(com.reactnativenavigation.options.params.Text) NullText(com.reactnativenavigation.options.params.NullText) 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)

Example 14 with Colour

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

the class ButtonPresenterTest method applyColor_shouldChangeDisabledColor.

@Test
public void applyColor_shouldChangeDisabledColor() {
    button.enabled = new Bool(false);
    MenuItem menuItem = addMenuButton();
    uut.applyOptions(titleBar, menuItem, buttonController::getView);
    ThemeColour disabledColor = new ThemeColour(new Colour(Color.BLUE), new Colour(Color.BLUE));
    uut.applyDisabledColor(titleBar, menuItem, disabledColor);
    assertThat(findButtonView().getCurrentTextColor()).isEqualTo(Color.BLUE);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) MenuItem(android.view.MenuItem) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 15 with Colour

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

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