use of com.benmu.framework.model.WebViewParamBean in project WeexErosFramework by bmfe.
the class DefaultRouterAdapter method toWebView.
public void toWebView(Context context, String params) {
if (TextUtils.isEmpty(params))
return;
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
WebViewParamBean webViewParamBean = parseManager.parseObject(params, WebViewParamBean.class);
String title = webViewParamBean.getTitle();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Constant.BMWEBVIEW_CATEGORY);
String type = webViewParamBean.getType() == null ? Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH : webViewParamBean.getType();
RouterModel routerModel = new RouterModel(null, type, null, title, webViewParamBean.isNavShow(), null);
intent.putExtra(Constant.ROUTERPARAMS, routerModel);
intent.putExtra(Constant.WEBVIEW_PARAMS, webViewParamBean);
if (context instanceof Activity) {
Activity activity = (Activity) context;
activity.startActivity(intent);
if (Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH.equals(routerModel.type)) {
activity.overridePendingTransition(R.anim.right_in, R.anim.view_stay);
} else if (Constant.ACTIVITIES_ANIMATION.ANIMATION_PRESENT.equals(routerModel.type)) {
activity.overridePendingTransition(R.anim.bottom_in, R.anim.view_stay);
} else if (Constant.ACTIVITIES_ANIMATION.ANIMATION_TRANSLATION.equals(routerModel.type)) {
activity.overridePendingTransition(R.anim.left_in, R.anim.view_stay);
} else {
activity.overridePendingTransition(R.anim.right_in, R.anim.view_stay);
}
}
}
Aggregations