use of com.reactnativenavigation.screens.ScreenStack in project react-native-navigation by wix.
the class BottomTabsLayout method push.
@Override
public void push(ScreenParams params) {
ScreenStack screenStack = getScreenStack(params.getNavigatorId());
screenStack.push(params, createScreenLayoutParams(params));
if (isCurrentStack(screenStack)) {
bottomTabs.setStyleFromScreen(params.styleParams);
EventBus.instance.post(new ScreenChangedEvent(params));
}
}
use of com.reactnativenavigation.screens.ScreenStack in project react-native-navigation by wix.
the class BottomTabsLayout method performOnStack.
private void performOnStack(String navigatorId, Task<ScreenStack> task, @Nullable Promise onPushComplete) {
try {
ScreenStack screenStack = getScreenStack(navigatorId);
task.run(screenStack);
} catch (ScreenStackNotFoundException e) {
if (onPushComplete != null) {
onPushComplete.reject("Navigation", "Could not perform action on stack [" + navigatorId + "]." + "This should not have happened, it probably means a navigator action" + "was called from an unmounted tab.");
}
Log.e("Navigation", "Could not perform action on stack [" + navigatorId + "]." + "This should not have happened, it probably means a navigator action" + "was called from an unmounted tab.");
}
}
use of com.reactnativenavigation.screens.ScreenStack in project react-native-navigation by wix.
the class BottomTabsLayout method popToRoot.
@Override
public void popToRoot(final ScreenParams params) {
performOnStack(params.getNavigatorId(), new Task<ScreenStack>() {
@Override
public void run(final ScreenStack stack) {
stack.popToRoot(params.animateScreenTransitions, params.timestamp, new ScreenStack.OnScreenPop() {
@Override
public void onScreenPopAnimationEnd() {
if (isCurrentStack(stack)) {
setBottomTabsStyleFromCurrentScreen();
alignSnackbarContainerWithBottomTabs((LayoutParams) snackbarAndFabContainer.getLayoutParams(), params.styleParams);
EventBus.instance.post(new ScreenChangedEvent(stack.peek().getScreenParams()));
}
}
});
}
});
}
use of com.reactnativenavigation.screens.ScreenStack in project react-native-navigation by wix.
the class SingleScreenLayout method createStack.
private void createStack(RelativeLayout parent) {
if (stack != null) {
stack.destroy();
}
stack = new ScreenStack(getActivity(), parent, screenParams.getNavigatorId(), this);
LayoutParams lp = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
pushInitialScreen(lp);
pushAdditionalScreens(lp);
}
Aggregations