Search in sources :

Example 1 with StorageManager

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

the class EventSetData method setData.

public void setData(Context context, ArrayList<String> paramsList, JSCallback jscallback) {
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    String key = paramsList.get(0);
    String value = paramsList.get(1);
    boolean result = storageManager.setData(context, key, value);
    if (result) {
        JsPoster.postSuccess(null, jscallback);
    } else {
        JsPoster.postFailed("存储失败", jscallback);
    }
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Example 2 with StorageManager

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

the class EventDeleteData method deleteDataSync.

public Object deleteDataSync(Context context, ArrayList<String> paramsList) {
    String key = paramsList.get(0);
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    boolean result = storageManager.deleteData(context, key);
    return result ? JsPoster.getSuccess() : JsPoster.getFailed("删除" + key + "失败");
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Example 3 with StorageManager

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

the class EventRemoveData method removeDataSync.

public Object removeDataSync(Context context) {
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    boolean result = storageManager.removeData(context);
    return result ? JsPoster.getSuccess(null) : JsPoster.getFailed();
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Example 4 with StorageManager

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

the class EventRemoveData method removeData.

public void removeData(Context context, JSCallback jscallback) {
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    boolean result = storageManager.removeData(context);
    if (result) {
        JsPoster.postSuccess(null, jscallback);
    } else {
        JsPoster.postFailed(jscallback);
    }
}
Also used : StorageManager(com.eros.framework.manager.StorageManager)

Example 5 with StorageManager

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

the class TabbarEvent method setTabbar.

private void setTabbar(WeexEventBean weexEventBean) {
    Context context = weexEventBean.getContext();
    StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
    storageManager.setData(context, Constant.SP.SP_TABBAR_JSON, weexEventBean.getJsParams());
}
Also used : Context(android.content.Context) 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