Search in sources :

Example 6 with ScreenChangedEvent

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

the class SingleScreenLayout method onModalDismissed.

@Override
public void onModalDismissed() {
    stack.peek().setStyle();
    stack.peek().getScreenParams().timestamp = System.currentTimeMillis();
    NavigationApplication.instance.getEventEmitter().sendWillAppearEvent(stack.peek().getScreenParams(), NavigationType.DismissModal);
    NavigationApplication.instance.getEventEmitter().sendDidAppearEvent(stack.peek().getScreenParams(), NavigationType.DismissModal);
    EventBus.instance.post(new ScreenChangedEvent(stack.peek().getScreenParams()));
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 7 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, Promise onPushComplete) {
    stack.push(params, new LayoutParams(MATCH_PARENT, MATCH_PARENT), onPushComplete);
    EventBus.instance.post(new ScreenChangedEvent(params));
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 8 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)

Example 9 with ScreenChangedEvent

use of com.reactnativenavigation.events.ScreenChangedEvent 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));
    }
}
Also used : ScreenStack(com.reactnativenavigation.screens.ScreenStack) ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent)

Example 10 with ScreenChangedEvent

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

the class ContentViewPagerAdapter method onPageSelected.

@Override
public void onPageSelected(int position) {
    EventBus.instance.post(new ViewPagerScreenChangedEvent());
    sendDisappearEvents(currentPosition);
    currentPosition = position;
    EventBus.instance.post(new ScreenChangedEvent(pageParams.get(currentPosition)));
    sendTabSelectedEventToJs();
    sendAppearEvents(position);
}
Also used : ScreenChangedEvent(com.reactnativenavigation.events.ScreenChangedEvent) ViewPagerScreenChangedEvent(com.reactnativenavigation.events.ViewPagerScreenChangedEvent) ViewPagerScreenChangedEvent(com.reactnativenavigation.events.ViewPagerScreenChangedEvent)

Aggregations

ScreenChangedEvent (com.reactnativenavigation.events.ScreenChangedEvent)14 ScreenStack (com.reactnativenavigation.screens.ScreenStack)4 ViewPagerScreenChangedEvent (com.reactnativenavigation.events.ViewPagerScreenChangedEvent)1