Search in sources :

Example 46 with WeexEventBean

use of com.eros.framework.model.WeexEventBean 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(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.eros.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSCallback(com.taobao.weex.bridge.JSCallback) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 47 with WeexEventBean

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

the class ModalModule method alert.

@JSMethod(uiThread = true)
public void alert(String options, final JSCallback callback) {
    WeexEventBean eventBean = new WeexEventBean();
    eventBean.setContext(mWXSDKInstance.getContext());
    eventBean.setKey(WXEventCenter.EVENT_MODAL_ALERT);
    eventBean.setJsParams(options);
    eventBean.setJscallback(callback);
    ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
Also used : WeexEventBean(com.eros.framework.model.WeexEventBean) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 48 with WeexEventBean

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

the class ModalModule method hideLoading.

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

Example 49 with WeexEventBean

use of com.eros.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(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.eros.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Example 50 with WeexEventBean

use of com.eros.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(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.eros.framework.model.WeexEventBean) ArrayList(java.util.ArrayList) JSMethod(com.taobao.weex.annotation.JSMethod)

Aggregations

WeexEventBean (com.eros.framework.model.WeexEventBean)55 JSMethod (com.taobao.weex.annotation.JSMethod)53 ArrayList (java.util.ArrayList)5 DispatchEventManager (com.eros.framework.manager.impl.dispatcher.DispatchEventManager)2 JSCallback (com.taobao.weex.bridge.JSCallback)2 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 RouterModel (com.eros.framework.model.RouterModel)1