Search in sources :

Example 1 with ScreenParams

use of com.reactnativenavigation.params.ScreenParams in project react-native-navigation by wix.

the class NavigationCommandsHandler method pop.

public static void pop(Bundle screenParams) {
    final NavigationActivity currentActivity = NavigationActivity.currentActivity;
    if (currentActivity == null) {
        return;
    }
    final ScreenParams params = ScreenParamsParser.parse(screenParams);
    NavigationApplication.instance.runOnMainThread(new Runnable() {

        @Override
        public void run() {
            currentActivity.pop(params);
        }
    });
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams)

Example 2 with ScreenParams

use of com.reactnativenavigation.params.ScreenParams in project react-native-navigation by wix.

the class NavigationCommandsHandler method popToRoot.

public static void popToRoot(Bundle screenParams) {
    final NavigationActivity currentActivity = NavigationActivity.currentActivity;
    if (currentActivity == null) {
        return;
    }
    final ScreenParams params = ScreenParamsParser.parse(screenParams);
    NavigationApplication.instance.runOnMainThread(new Runnable() {

        @Override
        public void run() {
            currentActivity.popToRoot(params);
        }
    });
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams)

Example 3 with ScreenParams

use of com.reactnativenavigation.params.ScreenParams in project react-native-navigation by wix.

the class NavigationCommandsHandler method push.

public static void push(Bundle screenParams) {
    final NavigationActivity currentActivity = NavigationActivity.currentActivity;
    if (currentActivity == null) {
        return;
    }
    final ScreenParams params = ScreenParamsParser.parse(screenParams);
    NavigationApplication.instance.runOnMainThread(new Runnable() {

        @Override
        public void run() {
            currentActivity.push(params);
        }
    });
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams)

Example 4 with ScreenParams

use of com.reactnativenavigation.params.ScreenParams in project react-native-navigation by wix.

the class NavigationCommandsHandler method showModal.

public static void showModal(Bundle params) {
    final NavigationActivity currentActivity = NavigationActivity.currentActivity;
    if (currentActivity == null) {
        return;
    }
    final ScreenParams screenParams = ScreenParamsParser.parse(params);
    NavigationApplication.instance.runOnMainThread(new Runnable() {

        @Override
        public void run() {
            currentActivity.showModal(screenParams);
        }
    });
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams)

Example 5 with ScreenParams

use of com.reactnativenavigation.params.ScreenParams in project react-native-navigation by wix.

the class BottomTabsLayout method createAndAddScreens.

private void createAndAddScreens(int position) {
    ScreenParams screenParams = params.tabParams.get(position);
    ScreenStack newStack = new ScreenStack(getActivity(), getScreenStackParent(), screenParams.getNavigatorId(), this);
    newStack.pushInitialScreen(screenParams, createScreenLayoutParams(screenParams));
    for (ScreenParams screen : screenParams.screens) {
        newStack.pushInitialScreen(screen, createScreenLayoutParams(screen));
    }
    screenStacks[position] = newStack;
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams) ScreenStack(com.reactnativenavigation.screens.ScreenStack)

Aggregations

ScreenParams (com.reactnativenavigation.params.ScreenParams)8 AHBottomNavigationItem (com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem)1 NavigationParams (com.reactnativenavigation.params.NavigationParams)1 ScreenStack (com.reactnativenavigation.screens.ScreenStack)1