• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WXBridgeManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.taobao.weex.bridge.WXBridgeManager的典型用法代码示例。如果您正苦于以下问题:Java WXBridgeManager类的具体用法?Java WXBridgeManager怎么用?Java WXBridgeManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WXBridgeManager类属于com.taobao.weex.bridge包,在下文中一共展示了WXBridgeManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pop

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void pop(String param, final String callbackId) {

    if (WXSDKEngine.getActivityNavBarSetter() != null) {
        if (WXSDKEngine.getActivityNavBarSetter().pop(param)) {
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_SUCCESS);
            return;
        }
    }

    if (mWXSDKInstance.getContext() instanceof Activity) {
        WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                                               MSG_SUCCESS);
        ((Activity) mWXSDKInstance.getContext()).finish();
    }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:18,代码来源:WXNavigatorModule.java


示例2: setNavBarLeftItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void setNavBarLeftItem(String param, final String callbackId) {
    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().setNavBarLeftItem(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);

}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:17,代码来源:WXNavigatorModule.java


示例3: onNewIntent

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent);
    if (intent == null) {
        return;
    }
    if (intent.getStringExtra("params") != null) {
        String params = intent.getStringExtra("params");
        String backTag = intent.getStringExtra("backTag");
        if (!TextUtils.isEmpty(params)) {
            WXComponent comp = mInstance.getRootComponent();
            if (comp != null) {
                WXEvent events = comp.getDomObject().getEvents();
                boolean hasActive = events.contains(UConstants.Event.ACTIVED);
                if (hasActive) {
                    Map<String, Object> data = new HashMap<>();
                    data.put("param", params);
                    data.put("tagCode", backTag);
                    WXBridgeManager.getInstance().fireEvent(mInstance.getInstanceId(), comp.getRef(), UConstants.Event.ACTIVED, data, null);
                }
            }
        }
    }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:26,代码来源:UWXFrameBaseActivity.java


示例4: onViewCreated

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@Override
    public void onViewCreated(WXSDKInstance wxsdkInstance, View view) {
        super.onViewCreated(wxsdkInstance, view);
        WXComponent comp = mInstance.getRootComponent();
        if (comp != null) {
            WXEvent events = comp.getDomObject().getEvents();
            boolean hasReady = events.contains(UConstants.Event.READY);
            if (hasReady) {
                Map<String, Object> data = new HashMap<>();
                data.put("param", wxInfo.getParam());
                WXBridgeManager.getInstance().fireEvent(mInstance.getInstanceId(), comp.getRef(), UConstants.Event.READY, data, null);
            }
        }
//        if (!isHasNavBar) {
//            setTranslateAnimation(getContainer());
//        }
    }
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:18,代码来源:UWXFrameBaseActivity.java


示例5: onPause

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@Override
public void onPause() {
    super.onPause();
    WXComponent comp = mInstance.getRootComponent();
    if (comp != null) {
        WXEvent events = comp.getDomObject().getEvents();
        boolean hasDeactived = events.contains(UConstants.Event.DEACTIVED);
        if (hasDeactived) {
            WXBridgeManager.getInstance().fireEvent(mInstance.getInstanceId(), comp.getRef(), UConstants.Event.DEACTIVED, null, null);
        }
    }
    if (mIsShakeDetectorStarted && mShakeDetector != null) {
        mShakeDetector.stop();
        mIsShakeDetectorStarted = false;
    }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:17,代码来源:UWXFrameBaseActivity.java


示例6: getSelectionRange

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@JSMethod
public void getSelectionRange(String callbackId) {
  EditText hostView;
  Map<String, Object> result = new HashMap<>(2);
  if ((hostView = getHostView()) != null) {
    int start = hostView.getSelectionStart();
    int end = hostView.getSelectionEnd();

    if (!hostView.hasFocus()) {
      //The default behavior, same as iOS and web
      start = 0;
      end = 0;
    }

    result.put(Constants.Name.SELECTION_START, start);
    result.put(Constants.Name.SELECTION_END, end);
  }
  WXBridgeManager.getInstance().callback(getInstanceId(), callbackId, result, false);
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:20,代码来源:AbstractEditComponent.java


示例7: setNavBarLeftItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void setNavBarLeftItem(String param, final String callbackId) {
    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().setNavBarLeftItem(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        WXConst.MSG_SUCCESS);
                return;
            }
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            WXConst.MSG_FAILED);

}
 
开发者ID:Laisly,项目名称:weex,代码行数:17,代码来源:WXNavigatorModule.java


示例8: setNavBarHidden

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@JSMethod
public void setNavBarHidden(String param, final String callback) {
    String message = MSG_FAILED;
    try {
        JSONObject jsObj = JSON.parseObject(param);
        int visibility = jsObj.getInteger(Constants.Name.NAV_BAR_VISIBILITY);
        boolean success = changeVisibilityOfActionBar(mWXSDKInstance.getContext(), visibility);
        if (success) {
            message = MSG_SUCCESS;
        }
    } catch (JSONException e) {
        WXLogUtils.e(TAG, WXLogUtils.getStackTrace(e));
    }
    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callback, message);
}
 
开发者ID:natjs,项目名称:nat-explorer,代码行数:16,代码来源:NavigatorModule.java


示例9: push

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void push(String param, final String callbackId) {

    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().push(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }

        try {
            JSONObject jsonObject = new JSONObject(param);
            String url = jsonObject.optString(URL, "");
            if (!TextUtils.isEmpty(url)) {
                Uri rawUri = Uri.parse(url);
                String scheme = rawUri.getScheme();
                Uri.Builder builder = rawUri.buildUpon();
                if (TextUtils.isEmpty(scheme)) {
                    builder.scheme("http");
                }
                Intent intent = new Intent(Intent.ACTION_VIEW, builder.build());
                intent.addCategory(WEEX);
                intent.putExtra(INSTANCE_ID, mWXSDKInstance.getInstanceId());
                mWXSDKInstance.getContext().startActivity(intent);
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
            }
        } catch (Exception e) {
            WXLogUtils.eTag(TAG, e);
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_FAILED);
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:40,代码来源:WXNavigatorModule.java


示例10: setNavBarRightItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void setNavBarRightItem(String param, final String callbackId) {
    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().setNavBarRightItem(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:16,代码来源:WXNavigatorModule.java


示例11: clearNavBarRightItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void clearNavBarRightItem(String param, final String callbackId) {
    if (WXSDKEngine.getActivityNavBarSetter() != null) {
        if (WXSDKEngine.getActivityNavBarSetter().clearNavBarRightItem(param)) {
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_SUCCESS);
            return;
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:14,代码来源:WXNavigatorModule.java


示例12: clearNavBarLeftItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void clearNavBarLeftItem(String param, final String callbackId) {
    if (WXSDKEngine.getActivityNavBarSetter() != null) {
        if (WXSDKEngine.getActivityNavBarSetter().clearNavBarLeftItem(param)) {
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_SUCCESS);
            return;
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:14,代码来源:WXNavigatorModule.java


示例13: setNavBarMoreItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void setNavBarMoreItem(String param, final String callbackId) {
    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().setNavBarMoreItem(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:16,代码来源:WXNavigatorModule.java


示例14: clearNavBarMoreItem

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void clearNavBarMoreItem(String param, final String callbackId) {
    if (WXSDKEngine.getActivityNavBarSetter() != null) {
        if (WXSDKEngine.getActivityNavBarSetter().clearNavBarMoreItem(param)) {
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_SUCCESS);
            return;
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:14,代码来源:WXNavigatorModule.java


示例15: setNavBarTitle

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno
public void setNavBarTitle(String param, final String callbackId) {
    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().setNavBarTitle(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:16,代码来源:WXNavigatorModule.java


示例16: setTimeout

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno(runOnUIThread = false)
public void setTimeout(int funcId, int delay) {
  if(delay<0){
    delay = 0;
  }
  if(funcId <= 0){
    return;
  }
  Message message = Message.obtain();
  message.what = WXJSBridgeMsgType.MODULE_TIMEOUT;
  message.arg1 = Integer.parseInt(mWXSDKInstance.getInstanceId());
  message.obj = funcId;
  WXBridgeManager.getInstance().sendMessageDelayed(message, delay);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:15,代码来源:WXTimerModule.java


示例17: clearTimeout

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno(runOnUIThread = false)
public void clearTimeout(int funcId) {
  if(funcId <= 0){
    return;
  }
  WXBridgeManager.getInstance().removeMessage(WXJSBridgeMsgType.MODULE_TIMEOUT, funcId);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:WXTimerModule.java


示例18: clearInterval

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
@WXModuleAnno(runOnUIThread = false)
public void clearInterval(int funcId) {
  if(funcId <= 0){
    return;
  }
  WXBridgeManager.getInstance().removeMessage(WXJSBridgeMsgType.MODULE_INTERVAL, funcId);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:WXTimerModule.java


示例19: setInterval

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
public static void setInterval(int funcId, int interval, int instanceId) {
  if(interval<0){
    interval = 0;
  }
  if(funcId <= 0){
    return;
  }
  Message message = Message.obtain();
  message.what = WXJSBridgeMsgType.MODULE_INTERVAL;
  message.arg1 = instanceId;
  message.arg2 = interval;
  message.obj = funcId;
  WXBridgeManager.getInstance().sendMessageDelayed(message, interval);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:15,代码来源:WXTimerModule.java


示例20: registerComponent

import com.taobao.weex.bridge.WXBridgeManager; //导入依赖的package包/类
public static boolean registerComponent(final String type, final IFComponentHolder holder, final Map<String, String> componentInfo) throws WXException {
  if (holder == null || TextUtils.isEmpty(type)) {
    return false;
  }

  //execute task in js thread to make sure register order is same as the order invoke register method.
  WXBridgeManager.getInstance()
      .post(new Runnable() {
    @Override
    public void run() {
      try {
        Map<String, String> registerInfo = componentInfo;
        if (registerInfo == null){
          registerInfo = new HashMap<>();
        }

        registerInfo.put("type",type);
        registerNativeComponent(type, holder);
        registerJSComponent(registerInfo);
        sComponentInfos.add(registerInfo);
      } catch (WXException e) {
        WXLogUtils.e("register component error:", e);
      }

    }
  });
  return true;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:29,代码来源:WXComponentRegistry.java



注:本文中的com.taobao.weex.bridge.WXBridgeManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractGremlinTest类代码示例发布时间:2022-05-23
下一篇:
Java CSVEntryConverter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap