Search in sources :

Example 81 with JSMethod

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

the class TitleModule method setCenterItem.

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

Example 82 with JSMethod

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

the class TitleModule method setNavigationInfo.

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

Example 83 with JSMethod

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

the class TitleModule method setRightItem.

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

Example 84 with JSMethod

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

the class ToolModule method resignKeyboard.

@JSMethod
public void resignKeyboard(JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_RESIGNKEYBOARD);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    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 85 with JSMethod

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

the class WebSocketModule method webSocket.

@JSMethod
public void webSocket(String url, String protocol) {
    webSocketAdapter = mWXSDKInstance.getWXWebSocketAdapter();
    Log.e("webSocket", "this>>>>>" + this + "id>>>>>" + mWXSDKInstance.getInstanceId());
    if (!reportErrorIfNoAdapter()) {
        LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
        bmWebSocketAdapter.connect(url, protocol, eventListener, mWXSDKInstance.getInstanceId());
    }
}
Also used : LightlyWebSocketAdapter(com.benmu.framework.extend.adapter.LightlyWebSocketAdapter) 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