use of com.reactnativenavigation.options.params.ThemeColour in project react-native-navigation by wix.
the class ButtonPresenterTest method applyColor_shouldChangeColor.
@Test
public void applyColor_shouldChangeColor() {
MenuItem menuItem = addMenuButton();
uut.applyOptions(titleBar, menuItem, buttonController::getView);
ThemeColour color = new ThemeColour(new Colour(Color.RED), new Colour(Color.RED));
uut.applyColor(titleBar, menuItem, color);
assertThat(findButtonView().getCurrentTextColor()).isEqualTo(Color.RED);
}
use of com.reactnativenavigation.options.params.ThemeColour in project react-native-navigation by wix.
the class ButtonPresenterTest method applyOptions_appliesColorOnButtonTextViewOnDarkMode.
@Test
public void applyOptions_appliesColorOnButtonTextViewOnDarkMode() {
mockConfiguration.uiMode = Configuration.UI_MODE_NIGHT_NO;
button.color = new ThemeColour(new Colour(Color.RED), new Colour(Color.BLACK));
MenuItem menuItem = addButtonAndApplyOptions();
assertThat(findButtonView().getCurrentTextColor()).isEqualTo(Color.RED);
mockConfiguration.uiMode = Configuration.UI_MODE_NIGHT_YES;
uut.applyOptions(titleBar, menuItem, buttonController::getView);
assertThat(findButtonView().getCurrentTextColor()).isEqualTo(Color.BLACK);
}
use of com.reactnativenavigation.options.params.ThemeColour in project react-native-navigation by wix.
the class ButtonSpanTest method createButton.
@NotNull
private ButtonOptions createButton() {
ButtonOptions button = new ButtonOptions();
button.color = new ThemeColour(new Colour(Color.RED));
return button;
}
use of com.reactnativenavigation.options.params.ThemeColour in project react-native-navigation by wix.
the class OptionsTest method clear_bottomTabsOptions.
@Test
public void clear_bottomTabsOptions() {
Options uut = new Options();
uut.bottomTabsOptions.backgroundColor = new ThemeColour(new Colour(Color.RED), new Colour(Color.RED));
uut.clearBottomTabsOptions();
assertThat(uut.bottomTabsOptions.backgroundColor.hasValue()).isFalse();
}
use of com.reactnativenavigation.options.params.ThemeColour 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);
}
Aggregations