Search in sources :

Example 71 with JSMethod

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

the class RouterModule method back.

@JSMethod(uiThread = true)
public void back(String params, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_BACK);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJsParams(params);
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 72 with JSMethod

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

the class RouterModule method nav.

@JSMethod(uiThread = true)
public void nav(String params) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_NAV);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJsParams(params);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 73 with JSMethod

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

the class ShareModule method relayToFriend.

@JSMethod
public void relayToFriend(String params, JSCallback successCallback, JSCallback failedCallback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_RELAYTOFRIEND);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJsParams(params);
    ArrayList<JSCallback> callbacks = new ArrayList<>();
    callbacks.add(successCallback);
    callbacks.add(failedCallback);
    weexEventBean.setCallbacks(callbacks);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSCallback(com.taobao.weex.bridge.JSCallback) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 74 with JSMethod

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

the class StorageModule method setData.

@JSMethod(uiThread = true)
public Object setData(String key, String value, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_SETDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    ArrayList<String> list = new ArrayList();
    list.add(key);
    list.add(value);
    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 75 with JSMethod

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

the class StorageModule method getDataSync.

@JSMethod(uiThread = false)
public Object getDataSync(String key) {
    ArrayList<String> list = new ArrayList();
    list.add(key);
    return new EventGetData().getDataSync(mWXSDKInstance.getContext(), list);
}
Also used : ArrayList(java.util.ArrayList) EventGetData(com.benmu.framework.event.shorage.EventGetData) 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