Search in sources :

Example 1 with ButtonOptions

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

the class TitleBarHelper method iconButton.

public static ButtonOptions iconButton(String id, String icon) {
    ButtonOptions button = new ButtonOptions();
    button.id = "someButton";
    button.icon = new Text(icon);
    return button;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Text(com.reactnativenavigation.options.params.Text)

Example 2 with ButtonOptions

use of com.reactnativenavigation.options.ButtonOptions 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;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ButtonOptions

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

the class TitleBarButtonControllerTest method createComponentButton.

private ButtonOptions createComponentButton() {
    ButtonOptions componentButton = new ButtonOptions();
    componentButton.id = "customBtn";
    componentButton.component.name = new Text("com.rnn.customBtn");
    componentButton.component.componentId = new Text("component4");
    return componentButton;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Text(com.reactnativenavigation.options.params.Text)

Example 4 with ButtonOptions

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

the class StackPresenter method mergeButtonsWithColor.

private List<ButtonOptions> mergeButtonsWithColor(@NonNull List<ButtonOptions> buttons, ThemeColour buttonColor, ThemeColour disabledColor) {
    List<ButtonOptions> result = new ArrayList<>();
    for (ButtonOptions button : buttons) {
        ButtonOptions copy = button.copy();
        if (!button.color.hasValue())
            copy.color = buttonColor;
        if (!button.disabledColor.hasValue())
            copy.disabledColor = disabledColor;
        result.add(copy);
    }
    return result;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) ArrayList(java.util.ArrayList)

Example 5 with ButtonOptions

use of com.reactnativenavigation.options.ButtonOptions 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;
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) Number(com.reactnativenavigation.options.params.Number) Text(com.reactnativenavigation.options.params.Text)

Aggregations

ButtonOptions (com.reactnativenavigation.options.ButtonOptions)10 Text (com.reactnativenavigation.options.params.Text)7 Colour (com.reactnativenavigation.options.params.Colour)3 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)3 Activity (android.app.Activity)2 TitleBarButtonCreatorMock (com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)2 Number (com.reactnativenavigation.options.params.Number)2 ButtonController (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController)2 ButtonPresenter (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter)2 ButtonBar (com.reactnativenavigation.views.stack.topbar.titlebar.ButtonBar)2 Color (android.graphics.Color)1 MenuItem (android.view.MenuItem)1 BaseTest (com.reactnativenavigation.BaseTest)1 TestUtils (com.reactnativenavigation.TestUtils)1 IconResolverFake (com.reactnativenavigation.fakes.IconResolverFake)1 ImageLoaderMock (com.reactnativenavigation.mocks.ImageLoaderMock)1 ComponentOptions (com.reactnativenavigation.options.ComponentOptions)1 Bool (com.reactnativenavigation.options.params.Bool)1 NullText (com.reactnativenavigation.options.params.NullText)1 IconResolver (com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver)1