Search in sources :

Example 1 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.

the class SingleScreenLayout method push.

@Override
public void push(ScreenParams params) {
    stack.push(params, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
    EventBus.instance.post(new ScreenChangedEvent(params));
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 2 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.

the class BottomTabsLayout method onBackPressed.

@Override
public boolean onBackPressed() {
    if (getCurrentScreenStack().handleBackPressInJs()) {
        return true;
    }
    if (getCurrentScreenStack().canPop()) {
        getCurrentScreenStack().pop(true);
        setBottomTabsStyleFromCurrentScreen();
        EventBus.instance.post(new ScreenChangedEvent(getCurrentScreenStack().peek().getScreenParams()));
        return true;
    } else {
        return false;
    }
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 3 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.

the class BottomTabsLayout method onTabSelected.

@Override
public boolean onTabSelected(int position, boolean wasSelected) {
    if (wasSelected) {
        return false;
    }
    hideCurrentStack();
    showNewStack(position);
    EventBus.instance.post(new ScreenChangedEvent(getCurrentScreenStack().peek().getScreenParams()));
    sendTabSelectedEventToJs();
    return true;
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 4 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.

the class SingleScreenLayout method newStack.

@Override
public void newStack(final ScreenParams params) {
    stack.newStack(params, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
    EventBus.instance.post(new ScreenChangedEvent(params));
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 5 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent in project react-native-navigation by wix.

the class BottomTabsLayout method newStack.

@Override
public void newStack(final ScreenParams params) {
    ScreenStack screenStack = getScreenStack(params.getNavigatorId());
    screenStack.newStack(params, createScreenLayoutParams(params));
    if (isCurrentStack(screenStack)) {
        bottomTabs.setStyleFromScreen(params.styleParams);
        EventBus.instance.post(new ScreenChangedEvent(params));
    }
}
Also used : ScreenStack(com.reactnativenavigation.screens.ScreenStack) ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Aggregations

ScreenChangedEvent (com.reactnativenavigation.events.ScreenChangedEvent)9 ScreenStack (com.reactnativenavigation.screens.ScreenStack)2 ViewPagerScreenChangedEvent (com.reactnativenavigation.events.ViewPagerScreenChangedEvent)1