use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.
the class BottomTabsLayout method switchTab.
private void switchTab(int position, NavigationType navigationType) {
hideCurrentStack();
showNewStack(position, navigationType);
EventBus.instance.post(new ScreenChangedEvent(getCurrentScreenStack().peek().getScreenParams()));
}
use of com.reactnativenavigation.events.ScreenChangedEvent 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.events.ScreenChangedEvent in project react-native-navigation by wix.
the class BottomTabsLayout method showInitialScreenStack.
private void showInitialScreenStack() {
bottomTabs.setVisibilityByInitialScreen(getInitialScreenStack().peek().getStyleParams());
showStackAndUpdateStyle(getInitialScreenStack(), NavigationType.InitialScreen);
EventBus.instance.post(new ScreenChangedEvent(screenStacks[0].peek().getScreenParams()));
}
use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.
the class SingleScreenLayout method onBackPressed.
@Override
public boolean onBackPressed() {
if (handleBackInJs()) {
return true;
}
if (stack.canPop()) {
stack.pop(true, System.currentTimeMillis());
EventBus.instance.post(new ScreenChangedEvent(stack.peek().getScreenParams()));
return true;
} else {
return false;
}
}
Aggregations