Search in sources :

Example 76 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class StorageModule method deleteData.

@JSMethod(uiThread = true)
public Object deleteData(String key, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_DELETEDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    ArrayList<String> list = new ArrayList();
    list.add(key);
    weexEventBean.setParamsList(list);
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
    return null;
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 77 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class StorageModule method removeData.

@JSMethod(uiThread = true)
public Object removeData(JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_REMOVEDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
    return null;
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 78 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class StorageModule method deleteDataSync.

@JSMethod(uiThread = false)
public Object deleteDataSync(String key) {
    ArrayList<String> list = new ArrayList();
    list.add(key);
    return new EventDeleteData().deleteDataSync(mWXSDKInstance.getContext(), list);
}
Also used : EventDeleteData(com.benmu.framework.event.shorage.EventDeleteData) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 79 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class StorageModule method getData.

@JSMethod(uiThread = true)
public Object getData(String key, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_GETDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    ArrayList<String> list = new ArrayList();
    list.add(key);
    weexEventBean.setParamsList(list);
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
    return null;
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 80 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class StorageModule method setDataSync.

// 同步存取
@JSMethod(uiThread = false)
public Object setDataSync(String key, String value) {
    ArrayList<String> list = new ArrayList();
    list.add(key);
    list.add(value);
    return new EventSetData().setDataSync(mWXSDKInstance.getContext(), list);
}
Also used : EventSetData(com.benmu.framework.event.shorage.EventSetData) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Aggregations

JSMethod (com.taobao.weex.annotation.JSMethod)85 WeexEventBean (com.benmu.framework.model.WeexEventBean)50 ArrayList (java.util.ArrayList)13 JSONObject (com.alibaba.fastjson.JSONObject)11 Intent (android.content.Intent)8 HashMap (java.util.HashMap)8 JSCallback (com.taobao.weex.bridge.JSCallback)7 Activity (android.app.Activity)4 EventCenter (com.benmu.framework.event.mediator.EventCenter)4 WXEditText (com.taobao.weex.ui.view.WXEditText)4 Map (java.util.Map)4 AlertDialog (android.app.AlertDialog)3 DialogInterface (android.content.DialogInterface)3 OnClickListener (android.content.DialogInterface.OnClickListener)3 Uri (android.net.Uri)3 EditText (android.widget.EditText)3 JSONException (com.alibaba.fastjson.JSONException)3 LightlyWebSocketAdapter (com.benmu.framework.extend.adapter.LightlyWebSocketAdapter)3 ClipData (android.content.ClipData)2 ClipboardManager (android.content.ClipboardManager)2