use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class EventModule method once.
@JSMethod
public void once(String type, JSCallback callback) {
if (!TextUtils.isEmpty(type) && callback != null) {
EventCenter.Event event = new EventCenter.Event(mWXSDKInstance.getInstanceId(), true, callback, mWXSDKInstance.getBundleUrl(), type);
Intent once = new Intent(WXConstant.WXEventCenter.EVENT_JS_ON);
once.putExtra("data", event);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(once);
}
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class GeolocationModule method getGeolocation.
@JSMethod(uiThread = true)
public void getGeolocation(JSCallback callback) {
WeexEventBean eventBean = new WeexEventBean();
eventBean.setContext(mWXSDKInstance.getContext());
eventBean.setKey(WXConstant.WXEventCenter.EVENT_GEOLOCATION_GET);
eventBean.setJscallback(callback);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class ImageModule method preview.
@JSMethod(uiThread = true)
public void preview(String json) {
WeexEventBean eventBean = new WeexEventBean();
eventBean.setContext(mWXSDKInstance.getContext());
eventBean.setKey(WXConstant.WXEventCenter.EVENT_BROWSERIMG);
eventBean.setJsParams(json);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class ImageModule method uploadScreenshot.
@JSMethod(uiThread = true)
public void uploadScreenshot(JSCallback callback) {
WeexEventBean eventBean = new WeexEventBean();
eventBean.setContext(mWXSDKInstance.getContext());
eventBean.setKey(WXConstant.WXEventCenter.EVENT_CAMERA_UPLOADSCREENSHOT);
eventBean.setJscallback(callback);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class ModalModule method hideLoading.
@JSMethod(uiThread = true)
public void hideLoading(JSCallback callback) {
WeexEventBean eventBean = new WeexEventBean();
eventBean.setContext(mWXSDKInstance.getContext());
eventBean.setKey(WXConstant.WXEventCenter.EVENT_MODAL_DISMISSLOADING);
eventBean.setJscallback(callback);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
Aggregations