use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class EventSetHomePage method setHomePage.
@SuppressWarnings("WrongConstant")
public void setHomePage(Context context, String params) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
storageManager.setData(context, Constant.SP.SP_HOMEPAGE_URL, params);
String homePage = BMWXEnvironment.mPlatformConfig.getPage().getHomePage(context);
RouterModel router = new RouterModel(homePage, Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH, null, null, false, null);
Intent intent = performStartActivity(router, DefaultRouterAdapter.getInstance().getPageCategory(context));
context.startActivity(intent);
// PendingIntent restartIntent = PendingIntent.getActivity(
// context.getApplicationContext(), 0, intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
// AlarmManager mgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100,
// restartIntent);
}
use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class DefaultRouterAdapter method open.
public boolean open(Context context, String params, JSCallback jsCallback) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
RouterModel routerModel = parseManager.parseObject(params, RouterModel.class);
if (jsCallback != null) {
routerModel.backCallback = (SimpleJSCallback) jsCallback;
}
return !(routerModel == null || !(context instanceof Activity)) && performStartActivity((Activity) context, routerModel, getPageCategory(context));
}
use of com.eros.framework.model.RouterModel in project WeexErosFramework by bmfe.
the class EventGetParams method getParams.
public void getParams(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 SplashActivityProxy method toHome.
private void toHome(Activity activity) {
String homePage = BMWXEnvironment.mPlatformConfig.getPage().getHomePage(activity);
String NavigationColor = BMWXEnvironment.mPlatformConfig.getPage().getNavBarColor();
RouterModel router = new RouterModel(homePage, Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH, null, null, false, null);
DispatchEventManager dispatchEventManager = ManagerFactory.getManagerService(DispatchEventManager.class);
WeexEventBean eventBean = new WeexEventBean();
eventBean.setKey(WXEventCenter.EVENT_OPEN);
eventBean.setJsParams(ManagerFactory.getManagerService(ParseManager.class).toJsonString(router));
eventBean.setContext(activity);
dispatchEventManager.getBus().post(eventBean);
activity.finish();
}
Aggregations