weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sospar...@apache.org
Subject incubator-weex git commit: * [android] add 'osName' to config
Date Mon, 03 Jul 2017 07:29:53 GMT
Repository: incubator-weex
Updated Branches:
  refs/heads/0.15-dev e0704aee6 -> 22a338ee6


* [android] add 'osName' to config


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/22a338ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/22a338ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/22a338ee

Branch: refs/heads/0.15-dev
Commit: 22a338ee60ebb3f38456fe329772150dcb5a897e
Parents: e0704ae
Author: sospartan <sospartan@apache.org>
Authored: Mon Jul 3 11:50:12 2017 +0800
Committer: sospartan <sospartan@apache.org>
Committed: Mon Jul 3 15:29:38 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/com/taobao/weex/WXEnvironment.java    |  4 ++++
 .../java/com/taobao/weex/bridge/WXBridgeManager.java    | 12 ++++++------
 .../src/main/java/com/taobao/weex/common/WXConfig.java  |  1 +
 doc/source/cn/references/weex-variable.md               |  1 +
 doc/source/references/weex-variable.md                  |  1 +
 5 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22a338ee/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
index 77eb536..2923dd8 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
@@ -83,6 +83,10 @@ public class WXEnvironment {
   public static boolean sShow3DLayer=true;
 
   private static Map<String, String> options = new HashMap<>();
+  static {
+    options.put(WXConfig.os, OS);
+    options.put(WXConfig.osName, OS);
+  }
 
   /**
    * dynamic

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22a338ee/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 2e8e928..d8f2f96 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -1353,14 +1353,14 @@ public class WXBridgeManager implements Callback,BactchExecutor {
   private WXParams assembleDefaultOptions() {
     Map<String, String> config = WXEnvironment.getConfig();
     WXParams wxParams = new WXParams();
-    wxParams.setPlatform(config.get("os"));
-    wxParams.setOsVersion(config.get("sysVersion"));
-    wxParams.setAppVersion(config.get("appVersion"));
-    wxParams.setWeexVersion(config.get("weexVersion"));
-    wxParams.setDeviceModel(config.get("sysModel"));
+    wxParams.setPlatform(config.get(WXConfig.os));
+    wxParams.setOsVersion(config.get(WXConfig.sysVersion));
+    wxParams.setAppVersion(config.get(WXConfig.appVersion));
+    wxParams.setWeexVersion(config.get(WXConfig.weexVersion));
+    wxParams.setDeviceModel(config.get(WXConfig.sysModel));
     wxParams.setShouldInfoCollect(config.get("infoCollect"));
     wxParams.setLogLevel(config.get(WXConfig.logLevel));
-    String appName = config.get("appName");
+    String appName = config.get(WXConfig.appName);
     if (!TextUtils.isEmpty(appName)) {
       wxParams.setAppName(appName);
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22a338ee/android/sdk/src/main/java/com/taobao/weex/common/WXConfig.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/common/WXConfig.java b/android/sdk/src/main/java/com/taobao/weex/common/WXConfig.java
index ffce700..44ca87f 100644
--- a/android/sdk/src/main/java/com/taobao/weex/common/WXConfig.java
+++ b/android/sdk/src/main/java/com/taobao/weex/common/WXConfig.java
@@ -21,6 +21,7 @@ package com.taobao.weex.common;
 public interface WXConfig {
 
   String os = "os";
+  String osName = "osName";
   String appVersion="appVersion";
   String devId="devId";
   String sysVersion="sysVersion";

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22a338ee/doc/source/cn/references/weex-variable.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/weex-variable.md b/doc/source/cn/references/weex-variable.md
index 4630681..0de2b37 100644
--- a/doc/source/cn/references/weex-variable.md
+++ b/doc/source/cn/references/weex-variable.md
@@ -20,6 +20,7 @@ has_chapter_content: true
     * `appName: string`: 应用名字。
     * `appVersion: string`: 应用版本。
     * `platform: string`: 平台信息,是 iOS、Android 还是 Web。
+    + `osName: string`: iOS或者android,表示操作系统的名称.
     * `osVersion: string`: 系统版本。
     * `deviceModel: string`: 设备型号 (仅原生应用)。
     * `deviceWidth: number`: 设备宽度。Weex 默认以宽度为 750px 做适配渲染,要获得750px下的屏幕高度,可以通过
`height = 750/deviceWidth*deviceHeight`  公式获得,可以使用到 CSS 中,用来设置全屏尺寸

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22a338ee/doc/source/references/weex-variable.md
----------------------------------------------------------------------
diff --git a/doc/source/references/weex-variable.md b/doc/source/references/weex-variable.md
index b55eef5..849e683 100644
--- a/doc/source/references/weex-variable.md
+++ b/doc/source/references/weex-variable.md
@@ -19,6 +19,7 @@ This variable contains all the environment information for the current Weex
page
 + `AppName: string`: application name.
 + `AppVersion: string`: app version.
 + `Platform: string`: platform information, that is iOS, Android or Web.
++ `osName: string`: OS name information, that is iOS, Android.
 + `OsVersion: string`: system version.
 + `DeviceModel: string`: device model (native application only).
 + `DeviceWidth: number`: device width


Mime
View raw message