Search in sources :

Example 6 with RouterModel

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);
}
Also used : RouterModel(com.eros.framework.model.RouterModel) StorageManager(com.eros.framework.manager.StorageManager) Intent(android.content.Intent)

Example 7 with RouterModel

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));
}
Also used : RouterModel(com.eros.framework.model.RouterModel) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 8 with RouterModel

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);
    }
}
Also used : RouterManager(com.eros.framework.manager.impl.RouterManager) RouterModel(com.eros.framework.model.RouterModel)

Example 9 with RouterModel

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();
}
Also used : RouterModel(com.eros.framework.model.RouterModel) WeexEventBean(com.eros.framework.model.WeexEventBean) DispatchEventManager(com.eros.framework.manager.impl.dispatcher.DispatchEventManager)

Aggregations

RouterModel (com.eros.framework.model.RouterModel)9 AbstractWeexActivity (com.eros.framework.activity.AbstractWeexActivity)4 ParseManager (com.eros.framework.manager.impl.ParseManager)4 Activity (android.app.Activity)3 Intent (android.content.Intent)2 RouterManager (com.eros.framework.manager.impl.RouterManager)2 StorageManager (com.eros.framework.manager.StorageManager)1 DispatchEventManager (com.eros.framework.manager.impl.dispatcher.DispatchEventManager)1 NatigatorModel (com.eros.framework.model.NatigatorModel)1 WebViewParamBean (com.eros.framework.model.WebViewParamBean)1 WeexEventBean (com.eros.framework.model.WeexEventBean)1 Map (java.util.Map)1