Search in sources :

Example 16 with WeexEventBean

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

the class RouterModule method open.

@JSMethod(uiThread = true)
public void open(String params, JSCallback backCallback, JSCallback resultCallback) {
    WeexEventBean eventBean = new WeexEventBean();
    eventBean.setKey(WXConstant.WXEventCenter.EVENT_OPEN);
    eventBean.setJsParams(params);
    ArrayList<JSCallback> callBacks = new ArrayList<>();
    callBacks.add(backCallback);
    callBacks.add(resultCallback);
    eventBean.setCallbacks(callBacks);
    eventBean.setContext(mWXSDKInstance.getContext());
    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)

Example 17 with WeexEventBean

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

the class RouterModule method refreshWeex.

@JSMethod
public void refreshWeex(JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_REFRESH);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    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 18 with WeexEventBean

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

the class RouterModule method setHomePage.

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

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

the class RouterModule method getBackParams.

@JSMethod(uiThread = true)
public void getBackParams(JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_GETBACKPARAMS);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    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 20 with WeexEventBean

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

the class RouterModule method finishPage.

@JSMethod(uiThread = true)
public void finishPage(String params, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_FINISH);
    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)

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