Search in sources :

Example 21 with WeexEventBean

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

the class RouterModule method getParams.

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

Example 22 with WeexEventBean

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

the class RouterModule method toWebView.

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

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

the class RouterModule method openBrowser.

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

Example 24 with WeexEventBean

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

the class ShareModule method share.

@JSMethod
public void share(String params, JSCallback success, JSCallback fail) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_SHARE);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJsParams(params);
    ArrayList<JSCallback> callbacks = new ArrayList<>();
    callbacks.add(success);
    callbacks.add(fail);
    weexEventBean.setCallbacks(callbacks);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
// if (params == null) {
// return;
// }
// ShareBean shareBean = BMJsonParsManager.parseObject(params, ShareBean.class);
// BMShareManager.getInstance().share((Activity) mWXSDKInstance.getContext(), shareBean,
// mWXSDKInstance.getContainerView(), success, fail);
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSCallback(com.taobao.weex.bridge.JSCallback) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 25 with WeexEventBean

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

the class ShareModule method relayToCricle.

@JSMethod
public void relayToCricle(String params, JSCallback successCallback, JSCallback failedCallback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_RELAYTOCRICLE);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    weexEventBean.setJsParams(params);
    ArrayList<JSCallback> callbacks = new ArrayList<>();
    callbacks.add(successCallback);
    callbacks.add(failedCallback);
    weexEventBean.setCallbacks(callbacks);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
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

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