Search in sources :

Example 31 with WeexEventBean

use of com.benmu.framework.model.WeexEventBean in project WeexErosFramework by bmfe.

the class WeChatLoginModule method wechat.

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

Example 32 with WeexEventBean

use of com.benmu.framework.model.WeexEventBean in project WeexErosFramework by bmfe.

the class AbstractWeexActivity method debugLayerClick.

private void debugLayerClick() {
    android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(mAct);
    builder.setItems(mDebugOptions, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (which == 0) {
                Intent intent = new Intent(mAct, DebugActivity.class);
                startActivity(intent);
            } else if (which == 1) {
                refresh();
            } else if (which == 2) {
                DispatchEventManager dispatchEventManager = ManagerFactory.getManagerService(DispatchEventManager.class);
                WeexEventBean eventBean = new WeexEventBean();
                eventBean.setContext(mAct);
                eventBean.setKey(WXConstant.WXEventCenter.EVENT_CAMERA);
                dispatchEventManager.getBus().post(eventBean);
            // connectionDebugService(BMWXEnvironment.mPlatformConfig.getUrl()
            // .getDebugServer());
            }
        }
    });
    builder.create().show();
}
Also used : DialogInterface(android.content.DialogInterface) WeexEventBean(com.benmu.framework.model.WeexEventBean) Intent(android.content.Intent) DispatchEventManager(com.benmu.framework.manager.impl.dispatcher.DispatchEventManager)

Example 33 with WeexEventBean

use of com.benmu.framework.model.WeexEventBean in project WeexErosFramework by bmfe.

the class AxiosModule method uploadImage.

@JSMethod
public void uploadImage(String params, final JSCallback jsCallback) {
    WeexEventBean eventBean = new WeexEventBean();
    eventBean.setContext(mWXSDKInstance.getContext());
    eventBean.setKey(WXConstant.WXEventCenter.EVENT_IMAGE_UPLOAD);
    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 34 with WeexEventBean

use of com.benmu.framework.model.WeexEventBean in project WeexErosFramework by bmfe.

the class CameraModule method cameraUpload.

@JSMethod
public void cameraUpload(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 35 with WeexEventBean

use of com.benmu.framework.model.WeexEventBean in project WeexErosFramework by bmfe.

the class CameraModule 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)

Aggregations

WeexEventBean (com.benmu.framework.model.WeexEventBean)51 JSMethod (com.taobao.weex.annotation.JSMethod)50 ArrayList (java.util.ArrayList)8 JSCallback (com.taobao.weex.bridge.JSCallback)5 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 DispatchEventManager (com.benmu.framework.manager.impl.dispatcher.DispatchEventManager)1