use of com.reactnativenavigation.params.FabActionParams in project react-native-navigation by wix.
the class FloatingActionButtonCoordinator method createAction.
private FloatingActionButton createAction(int index) {
final FabActionParams actionParams = params.actions.get(index);
FloatingActionButton action = createFab(actionParams.icon);
action.setLayoutParams(createActionLayoutParams(index));
action.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavigationApplication.instance.getEventEmitter().sendNavigatorEvent(actionParams.id, actionParams.navigatorEventId);
fabAnimator.collapse();
}
});
if (actionParams.backgroundColor.hasColor()) {
action.setBackgroundTintList(ColorStateList.valueOf(actionParams.backgroundColor.getColor()));
}
action.setSize(FloatingActionButton.SIZE_MINI);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
action.setCompatElevation(0);
}
return action;
}
use of com.reactnativenavigation.params.FabActionParams in project react-native-navigation by wix.
the class FabActionParamsParser method parse.
public FabActionParams parse(Bundle params, String navigatorEventId) {
FabActionParams fabActionParams = new FabActionParams();
fabActionParams.id = params.getString("id");
fabActionParams.navigatorEventId = navigatorEventId;
fabActionParams.icon = ImageLoader.loadImage(params.getString("icon"));
fabActionParams.backgroundColor = StyleParams.Color.parse(params, "backgroundColor");
fabActionParams.iconColor = StyleParams.Color.parse(params, "iconColor");
if (fabActionParams.iconColor.hasColor()) {
ViewUtils.tintDrawable(fabActionParams.icon, fabActionParams.iconColor.getColor(), true);
}
return fabActionParams;
}
Aggregations