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);
}
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);
}
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);
}
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);
}
}
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);
}
}
Aggregations