Search in sources :

Example 21 with JSMethod

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

the class ImageModule method camera.

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

Example 22 with JSMethod

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

the class ImageModule method uploadImage.

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

Example 23 with JSMethod

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

the class ImageModule method pick.

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

Example 24 with JSMethod

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

the class ModalModule method showLoading.

@JSMethod(uiThread = true)
public void showLoading(String options, JSCallback callback) {
    WeexEventBean eventBean = new WeexEventBean();
    eventBean.setContext(mWXSDKInstance.getContext());
    eventBean.setKey(WXConstant.WXEventCenter.EVENT_MODAL_SHOWLOADING);
    eventBean.setJsParams(options);
    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 25 with JSMethod

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

the class ModalModule method confirm.

@JSMethod(uiThread = true)
public void confirm(String options, final JSCallback cancel, final JSCallback ok) {
    WeexEventBean eventBean = new WeexEventBean();
    eventBean.setContext(mWXSDKInstance.getContext());
    eventBean.setKey(WXConstant.WXEventCenter.EVENT_MODAL_CONFIRM);
    eventBean.setJsParams(options);
    ArrayList<JSCallback> jsCallbacks = new ArrayList<>();
    jsCallbacks.add(cancel);
    jsCallbacks.add(ok);
    eventBean.setCallbacks(jsCallbacks);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSCallback(com.taobao.weex.bridge.JSCallback) 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