Search in sources :

Example 16 with JSMethod

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

the class CameraModule method scan.

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

Example 17 with JSMethod

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

the class CommunicationModule method sms.

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

Example 18 with JSMethod

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

the class CommunicationModule method call.

@JSMethod
public void call(String params) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_CALL);
    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 19 with JSMethod

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

the class EventModule method emit.

@JSMethod
public void emit(String type, Object params) {
    if (!TextUtils.isEmpty(type)) {
        Intent emit = new Intent(WXConstant.WXEventCenter.EVENT_JS_EMIT);
        emit.putExtra("data", new EventCenter.Emit(type, params));
        ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(emit);
    }
}
Also used : EventCenter(com.benmu.framework.event.mediator.EventCenter) Intent(android.content.Intent) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 20 with JSMethod

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

the class EventModule method on.

@JSMethod
public void on(String type, JSCallback callback) {
    if (!TextUtils.isEmpty(type) && callback != null) {
        EventCenter.Event event = new EventCenter.Event(mWXSDKInstance.getInstanceId(), false, callback, mWXSDKInstance.getBundleUrl(), type);
        Intent on = new Intent(WXConstant.WXEventCenter.EVENT_JS_ON);
        on.putExtra("data", event);
        ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(on);
    }
}
Also used : EventCenter(com.benmu.framework.event.mediator.EventCenter) Intent(android.content.Intent) JSMethod(com.taobao.weex.annotation.JSMethod)

Aggregations

JSMethod (com.taobao.weex.annotation.JSMethod)198 WeexEventBean (com.eros.framework.model.WeexEventBean)53 WeexEventBean (com.benmu.framework.model.WeexEventBean)50 JSONObject (com.alibaba.fastjson.JSONObject)32 ArrayList (java.util.ArrayList)25 HashMap (java.util.HashMap)20 Intent (android.content.Intent)19 JSCallback (com.taobao.weex.bridge.JSCallback)12 Activity (android.app.Activity)11 WXEditText (com.taobao.weex.ui.view.WXEditText)8 Map (java.util.Map)8 Uri (android.net.Uri)7 AlertDialog (android.app.AlertDialog)6 Context (android.content.Context)6 DialogInterface (android.content.DialogInterface)6 OnClickListener (android.content.DialogInterface.OnClickListener)6 EditText (android.widget.EditText)6 JSONException (com.alibaba.fastjson.JSONException)6 Invoker (com.taobao.weex.bridge.Invoker)5 MethodInvoker (com.taobao.weex.bridge.MethodInvoker)5