Search in sources :

Example 36 with JSMethod

use of com.taobao.weex.annotation.JSMethod 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 37 with JSMethod

use of com.taobao.weex.annotation.JSMethod 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 38 with JSMethod

use of com.taobao.weex.annotation.JSMethod 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 39 with JSMethod

use of com.taobao.weex.annotation.JSMethod 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)

Example 40 with JSMethod

use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.

the class TitleModule method setLeftItem.

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

Aggregations

JSMethod (com.taobao.weex.annotation.JSMethod)198 WeexEventBean (com.eros.framework.model.WeexEventBean)53 WeexEventBean (com.benmu.framework.model.WeexEventBean)50 JSONObject (com.alibaba.fastjson.JSONObject)32 ArrayList (java.util.ArrayList)25 HashMap (java.util.HashMap)20 Intent (android.content.Intent)19 JSCallback (com.taobao.weex.bridge.JSCallback)12 Activity (android.app.Activity)11 WXEditText (com.taobao.weex.ui.view.WXEditText)8 Map (java.util.Map)8 Uri (android.net.Uri)7 AlertDialog (android.app.AlertDialog)6 Context (android.content.Context)6 DialogInterface (android.content.DialogInterface)6 OnClickListener (android.content.DialogInterface.OnClickListener)6 EditText (android.widget.EditText)6 JSONException (com.alibaba.fastjson.JSONException)6 Invoker (com.taobao.weex.bridge.Invoker)5 MethodInvoker (com.taobao.weex.bridge.MethodInvoker)5