use of com.reactnativenavigation.options.params.Number in project react-native-navigation by wix.
the class OptionsTest method clear_topTabsOptions.
@Test
public void clear_topTabsOptions() {
Options uut = new Options();
uut.topTabs.fontSize = new Number(666);
uut.clearTopTabsOptions();
assertThat(uut.topTabs.fontSize.hasValue()).isFalse();
}
use of com.reactnativenavigation.options.params.Number in project react-native-navigation by wix.
the class SideMenuControllerTest method setRightController_setHeightAndWidthWithOptions.
@Test
public void setRightController_setHeightAndWidthWithOptions() {
SideMenuOptions options = new SideMenuOptions();
options.height = new Number(100);
options.width = new Number(200);
uut.options.sideMenuRootOptions.left = options;
SimpleComponentViewController componentViewController = new SimpleComponentViewController(activity, childRegistry, "left", new Options());
uut.setLeftController(componentViewController);
int heightInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, Resources.getSystem().getDisplayMetrics());
int widthInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, Resources.getSystem().getDisplayMetrics());
LayoutParams params = componentViewController.getView().getLayoutParams();
assertThat(params.width).isEqualTo(widthInDp);
assertThat(params.height).isEqualTo(heightInDp);
}
use of com.reactnativenavigation.options.params.Number in project react-native-navigation by wix.
the class SideMenuControllerTest method setLeftController_setHeightAndWidthWithOptions.
@Test
public void setLeftController_setHeightAndWidthWithOptions() {
SideMenuOptions options = new SideMenuOptions();
options.height = new Number(100);
options.width = new Number(200);
uut.options.sideMenuRootOptions.left = options;
SimpleComponentViewController componentViewController = new SimpleComponentViewController(activity, childRegistry, "left", new Options());
uut.setLeftController(componentViewController);
int heightInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, Resources.getSystem().getDisplayMetrics());
int widthInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, Resources.getSystem().getDisplayMetrics());
LayoutParams params = componentViewController.getView().getLayoutParams();
assertThat(params.width).isEqualTo(widthInDp);
assertThat(params.height).isEqualTo(heightInDp);
}
use of com.reactnativenavigation.options.params.Number 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);
}
use of com.reactnativenavigation.options.params.Number in project react-native-navigation by wix.
the class ButtonPresenterTest method createButton.
private ButtonOptions createButton() {
ButtonOptions b = new ButtonOptions();
b.id = "btn1";
b.text = new Text(BTN_TEXT);
b.showAsAction = new Number(MenuItem.SHOW_AS_ACTION_ALWAYS);
return b;
}
Aggregations