use of com.reactnativenavigation.views.stack.fab.FabMenu in project react-native-navigation by wix.
the class FabPresenter method createFab.
private void createFab(ViewController<?> component, FabOptions options) {
ViewExtensionsKt.removeFromParent(fabMenu);
ViewExtensionsKt.removeFromParent(fab);
if (options.actionsArray.size() > 0) {
fabMenu = new FabMenu(viewGroup.getContext(), options.id.get());
setParams(component, fabMenu, options);
applyFabMenuOptions(component, fabMenu, options);
viewGroup.addView(fabMenu);
} else {
fab = new Fab(viewGroup.getContext(), options.id.get());
setParams(component, fab, options);
applyFabOptions(component, fab, options);
viewGroup.addView(fab);
fab.setOnClickListener(v -> component.sendOnNavigationButtonPressed(options.id.get()));
UiUtils.doOnLayout(fab, () -> {
fab.setPivotX(fab.getWidth() / 2f);
fab.setPivotY(fab.getHeight() / 2f);
});
}
}