Search in sources :

Example 1 with SnackbarParams

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

the class NavigationReactModule method showSnackbar.

@ReactMethod
public void showSnackbar(final ReadableMap params) {
    SnackbarParams snackbarParams = new SnackbarParamsParser().parse(BundleConverter.toBundle(params));
    NavigationCommandsHandler.showSnackbar(snackbarParams);
}
Also used : SnackbarParamsParser(com.reactnativenavigation.params.parsers.SnackbarParamsParser) SnackbarParams(com.reactnativenavigation.params.SnackbarParams) ReactMethod(com.facebook.react.bridge.ReactMethod)

Example 2 with SnackbarParams

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

the class SnackbarParamsParser method parse.

public SnackbarParams parse(Bundle params) {
    SnackbarParams result = new SnackbarParams();
    result.text = params.getString("text");
    result.textColor = getColor(params, "textColor", new StyleParams.Color(Color.WHITE));
    result.buttonText = params.getString("actionText");
    result.buttonColor = getColor(params, "actionColor", AppStyle.appStyle.snackbarButtonColor);
    result.backgroundColor = getColor(params, "backgroundColor");
    result.duration = getDuration(params.getString("duration", "short"));
    result.eventId = params.getString("actionId");
    return result;
}
Also used : Color(android.graphics.Color) SnackbarParams(com.reactnativenavigation.params.SnackbarParams)

Aggregations

SnackbarParams (com.reactnativenavigation.params.SnackbarParams)2 Color (android.graphics.Color)1 ReactMethod (com.facebook.react.bridge.ReactMethod)1 SnackbarParamsParser (com.reactnativenavigation.params.parsers.SnackbarParamsParser)1