Search in sources :

Example 41 with WeexEventBean

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

the class RouterModule method back.

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

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

the class RouterModule method nav.

@JSMethod(uiThread = true)
public void nav(String params) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_NAV);
    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 43 with WeexEventBean

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

the class ShareModule method relayToFriend.

@JSMethod
public void relayToFriend(String params, JSCallback successCallback, JSCallback failedCallback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_RELAYTOFRIEND);
    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)

Example 44 with WeexEventBean

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

the class StorageModule method setData.

@JSMethod(uiThread = true)
public Object setData(String key, String value, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_SETDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    ArrayList<String> list = new ArrayList();
    list.add(key);
    list.add(value);
    weexEventBean.setParamsList(list);
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
    return null;
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 45 with WeexEventBean

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

the class StorageModule method deleteData.

@JSMethod(uiThread = true)
public Object deleteData(String key, JSCallback callback) {
    WeexEventBean weexEventBean = new WeexEventBean();
    weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_DELETEDATA);
    weexEventBean.setContext(mWXSDKInstance.getContext());
    ArrayList<String> list = new ArrayList();
    list.add(key);
    weexEventBean.setParamsList(list);
    weexEventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
    return null;
}
Also used : WeexEventBean(com.benmu.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) 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