Search in sources :

Example 1 with NavigationParams

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

the class SlidingOverlayParamsParser method parse.

public SlidingOverlayParams parse(Bundle bundle) {
    final SlidingOverlayParams result = new SlidingOverlayParams();
    result.screenInstanceId = bundle.getString("screen");
    result.navigationParams = new NavigationParams(bundle.getBundle("navigationParams"));
    result.autoDismissTimerSec = bundle.containsKey("autoDismissTimerSec") ? bundle.getInt("autoDismissTimerSec") : null;
    result.position = SlidingOverlayParams.Position.fromString(bundle.getString("position", "top"));
    return result;
}
Also used : SlidingOverlayParams(com.reactnativenavigation.params.SlidingOverlayParams) NavigationParams(com.reactnativenavigation.params.NavigationParams)

Example 2 with NavigationParams

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

the class TopTabParamsParser method parseItem.

@NonNull
private static PageParams parseItem(Bundle params) {
    PageParams result = new PageParams();
    result.screenId = params.getString(KEY_SCREEN_ID);
    result.title = params.getString(KEY_TITLE);
    result.tabIcon = new TabIconParser(params).parse();
    result.navigationParams = new NavigationParams(params.getBundle(NAVIGATION_PARAMS));
    result.leftButton = ButtonParser.parseLeftButton(params);
    result.rightButtons = ButtonParser.parseRightButton(params);
    result.fabParams = ButtonParser.parseFab(params, result.navigationParams.navigatorEventId, result.navigationParams.screenInstanceId);
    result.styleParams = new StyleParamsParser(params.getBundle("styleParams")).parse();
    return result;
}
Also used : PageParams(com.reactnativenavigation.params.PageParams) NavigationParams(com.reactnativenavigation.params.NavigationParams) NonNull(android.support.annotation.NonNull)

Example 3 with NavigationParams

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

the class LightBoxParamsParser method parse.

public LightBoxParams parse() {
    LightBoxParams result = new LightBoxParams();
    if (params.isEmpty()) {
        return result;
    }
    result.screenId = params.getString("screenId");
    result.navigationParams = new NavigationParams(params.getBundle("navigationParams"));
    result.backgroundColor = getColor(params, "backgroundColor");
    result.tapBackgroundToDismiss = params.getBoolean("tapBackgroundToDismiss");
    result.overrideBackPress = params.getBoolean("overrideBackPress");
    result.adjustSoftInput = Adjustment.fromString(params.getString("adjustSoftInput")).value;
    return result;
}
Also used : LightBoxParams(com.reactnativenavigation.params.LightBoxParams) NavigationParams(com.reactnativenavigation.params.NavigationParams)

Example 4 with NavigationParams

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

the class ScreenParamsParser method parse.

@SuppressWarnings("ConstantConditions")
public static ScreenParams parse(Bundle params) {
    ScreenParams result = new ScreenParams();
    result.screenId = params.getString(KEY_SCREEN_ID);
    result.timestamp = params.getDouble(KEY_TIMESTAMP);
    assertKeyExists(params, KEY_NAVIGATION_PARAMS);
    result.navigationParams = new NavigationParams(params.getBundle(KEY_NAVIGATION_PARAMS));
    result.styleParams = new StyleParamsParser(params.getBundle(STYLE_PARAMS)).parse();
    result.title = params.getString(KEY_TITLE);
    result.subtitle = params.getString(KEY_SUBTITLE);
    result.rightButtons = ButtonParser.parseRightButton(params);
    result.overrideBackPressInJs = params.getBoolean(OVERRIDE_BACK_PRESS, false);
    result.leftButton = ButtonParser.parseLeftButton(params);
    result.topTabParams = parseTopTabs(params);
    if (hasKey(params, "screens")) {
        result.screens = parseScreens(params.getBundle("screens"));
    }
    if (hasKey(params, FRAGMENT_CREATOR_CLASS_NAME)) {
        result.fragmentCreatorClassName = params.getString(FRAGMENT_CREATOR_CLASS_NAME);
        result.fragmentCreatorPassProps = params.getBundle(FRAGMENT_CREATOR_PASS_PROPS);
    }
    result.fabParams = ButtonParser.parseFab(params, result.navigationParams.navigatorEventId, result.navigationParams.screenInstanceId);
    result.tabLabel = getTabLabel(params);
    result.tabIcon = new TabIconParser(params).parse();
    result.animateScreenTransitions = new AnimationParser(params).parse();
    result.sharedElementsTransitions = getSharedElementsTransitions(params);
    result.animationType = params.getString(ANIMATION_TYPE, AppStyle.appStyle.screenAnimationType);
    return result;
}
Also used : ScreenParams(com.reactnativenavigation.params.ScreenParams) NavigationParams(com.reactnativenavigation.params.NavigationParams)

Example 5 with NavigationParams

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

the class SideMenuParamsParser method parseSideMenu.

private static SideMenuParams parseSideMenu(@Nullable Bundle sideMenu, Side side) {
    if (sideMenu == null || sideMenu.isEmpty()) {
        return null;
    }
    SideMenuParams result = new SideMenuParams();
    result.screenId = sideMenu.getString("screenId");
    result.navigationParams = new NavigationParams(sideMenu.getBundle("navigationParams"));
    result.disableOpenGesture = sideMenu.getBoolean("disableOpenGesture", false);
    result.fixedWidth = sideMenu.getInt("fixedWidth", 0);
    result.side = side;
    return result;
}
Also used : SideMenuParams(com.reactnativenavigation.params.SideMenuParams) NavigationParams(com.reactnativenavigation.params.NavigationParams)

Aggregations

NavigationParams (com.reactnativenavigation.params.NavigationParams)6 NonNull (android.support.annotation.NonNull)1 ContextualMenuParams (com.reactnativenavigation.params.ContextualMenuParams)1 LightBoxParams (com.reactnativenavigation.params.LightBoxParams)1 PageParams (com.reactnativenavigation.params.PageParams)1 ScreenParams (com.reactnativenavigation.params.ScreenParams)1 SideMenuParams (com.reactnativenavigation.params.SideMenuParams)1 SlidingOverlayParams (com.reactnativenavigation.params.SlidingOverlayParams)1