use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setTabbarNavigation.
public static void setTabbarNavigation(Activity activity, NavigatorModel navigatorModel) {
if (activity instanceof AbstractWeexActivity) {
RouterModel routerModel = ((AbstractWeexActivity) activity).getRouterParam();
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
NatigatorModel model = parseManager.parseObject(navigatorModel.navigatorModel, NatigatorModel.class);
routerModel.navShow = model.isNavShow();
routerModel.navTitle = model.getTitle();
routerModel.canBack = false;
((AbstractWeexActivity) activity).setRouterParam(routerModel);
((AbstractWeexActivity) activity).setNavigationBar();
StatusBarManager.setHeaderBg(routerModel, (AbstractWeexActivity) activity);
}
}
use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class DefaultRouterAdapter method back.
public boolean back(Context context, String params) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
RouterModel routerModel = parseManager.parseObject(params, RouterModel.class);
int backLength = routerModel.length;
if (backLength >= RouterTracker.length()) {
RouterTracker.clearActivitySurplus(1);
} else {
for (int i = 0; i < backLength; i++) {
RouterTracker.popActivity();
}
}
Object backParams = routerModel.params;
if (backParams instanceof Map) {
if (((Map) backParams).size() > 0) {
Activity activity = RouterTracker.peekActivity();
if (activity instanceof AbstractWeexActivity) {
// 设置back参数
((AbstractWeexActivity) activity).setRouterParam(routerModel);
}
}
}
return true;
}
use of com.eros.framework.model.RouterModel 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(getWebViewCategory(context));
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);
}
}
}
use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class EventGetBackParams method getBackParams.
public void getBackParams(Context context, JSCallback jscallback) {
RouterManager routerManager = ManagerFactory.getManagerService(RouterManager.class);
RouterModel routerModel = routerManager.getParams(context);
if (routerModel != null && jscallback != null) {
jscallback.invoke(routerModel.params);
}
}
use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class PersistentManager method getCacheRouter.
public RouterModel getCacheRouter() {
RouterModel router = mCacheRouter;
mCacheRouter = null;
return router;
}
Aggregations