Search in sources :

Example 6 with StorageManager

use of com.eros.framework.manager.StorageManager in project WeexErosFramework by bmfe.

the class RouterModule method clearHomePage.

@JSMethod
public void clearHomePage() {
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    storageManager.setData(mWXSDKInstance.getContext(), Constant.SP.SP_HOMEPAGE_URL, "");
}
Also used : StorageManager(com.eros.framework.manager.StorageManager) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 7 with StorageManager

use of com.eros.framework.manager.StorageManager in project WeexErosFramework by bmfe.

the class SplashActivityProxy method initTabbar.

private void initTabbar(Activity activity) {
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    String bar = storageManager.getData(activity, Constant.SP.SP_TABBAR_JSON);
    if (!TextUtils.isEmpty(bar)) {
        PlatformConfigBean.TabBar bean = ManagerFactory.getManagerService(ParseManager.class).parseObject(bar, PlatformConfigBean.TabBar.class);
        BMWXEnvironment.mPlatformConfig.setTabBar(bean);
    }
}
Also used : PlatformConfigBean(com.eros.framework.model.PlatformConfigBean) StorageManager(com.eros.framework.manager.StorageManager) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 8 with StorageManager

use of com.eros.framework.manager.StorageManager 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 9 with StorageManager

use of com.eros.framework.manager.StorageManager in project WeexErosFramework by bmfe.

the class EventGetData method getData.

public void getData(Context context, ArrayList<String> paramsList, JSCallback jscallback) {
    String key = paramsList.get(0);
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    String result = storageManager.getData(context, key);
    if (TextUtils.isEmpty(result)) {
        JsPoster.postFailed(jscallback);
    } else {
        JsPoster.postSuccess(result, jscallback);
    }
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Example 10 with StorageManager

use of com.eros.framework.manager.StorageManager in project WeexErosFramework by bmfe.

the class EventGetData method getDataSync.

public Object getDataSync(Context context, ArrayList<String> list) {
    String key = list.get(0);
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    String result = storageManager.getData(context, key);
    return result == null ? JsPoster.getFailed() : JsPoster.getSuccess(result);
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Aggregations

StorageManager (com.eros.framework.manager.StorageManager)12 Context (android.content.Context)1 Intent (android.content.Intent)1 ParseManager (com.eros.framework.manager.impl.ParseManager)1 PlatformConfigBean (com.eros.framework.model.PlatformConfigBean)1 RouterModel (com.eros.framework.model.RouterModel)1 JSMethod (com.taobao.weex.annotation.JSMethod)1