You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2018/03/09 13:53:01 UTC

[1/4] incubator-weex-site git commit: Correct extend-android-en.md several errors

Repository: incubator-weex-site
Updated Branches:
  refs/heads/master 3770be6f8 -> a08652002


Correct extend-android-en.md several errors

I corrected extend-android-en.md several errors and update Component according to the latest Weex sdk.

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

Branch: refs/heads/master
Commit: 84ddbb4ef8dea084098ee0a3fb08d0566b70964f
Parents: c941b0d
Author: shikechen <80...@qq.com>
Authored: Fri Mar 9 17:11:44 2018 +0800
Committer: GitHub <no...@github.com>
Committed: Fri Mar 9 17:11:44 2018 +0800

----------------------------------------------------------------------
 source/guide/extend-android.md | 46 ++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/84ddbb4e/source/guide/extend-android.md
----------------------------------------------------------------------
diff --git a/source/guide/extend-android.md b/source/guide/extend-android.md
index 9f83512..c23f218 100644
--- a/source/guide/extend-android.md
+++ b/source/guide/extend-android.md
@@ -15,7 +15,7 @@ version: 2.1
 3. The access level of mehtod must be `public`.
 4. Do not obfuscate code using tools like ProGuard.
 5. Extended method suppport the data type of int, double, float, String, Map, List as its param.
-7. Register the module: `WXSDKEngine.registerModule("myModule", MyModule.class);`or else may report an error: `ReportException :undefined:9: TypeError: Object #<Object> has no method 'xxx'` .
+7. Register the module: `WXSDKEngine.registerModule("MyModule", MyModule.class);`or else may report an error: `ReportException :undefined:9: TypeError: Object #<Object> has no method 'xxx'` .
 
 Refer to the following example:
 
@@ -38,7 +38,7 @@ public class MyModule extends WXModule{
 Register the module
 
 ```java
-WXSDKEngine.registerModule("MyModule", WXEventModule.class);
+WXSDKEngine.registerModule("MyModule", MyModule.class);
 ```
 Use this module in weex DSL
 Now `event` moudle is avaiable in weex, use the module like this:
@@ -54,7 +54,7 @@ Now `event` moudle is avaiable in weex, use the module like this:
   module.exports = {
     methods: {
       click: function() {
-        weex.requireModule('myModule').printLog("I am a weex Module!");
+        weex.requireModule('MyModule').printLog("I am a weex Module!");
       }
     }
   }
@@ -83,7 +83,7 @@ event.openURL("http://www.github.com",function(resp){ console.log(resp.result);
 
 ## Component extend
 
-1. Customize components must extend from WXComponent or WXContainer
+1. Customize components must extend from WXComponent
 2. Use the `@WXComponentProp(name = value(value is attr or style))` annotation to let the update of attribute or style be recognized automatically.
 3. The access levels of mehtod must be **public**
 4. Customize can not be obfuscated by tools like ProGuard
@@ -94,30 +94,30 @@ event.openURL("http://www.github.com",function(resp){ console.log(resp.result);
 Refer to the following example
 
 ```java
-public class RichText extends WXComponent {
+public class RichText extends WXComponent<TextView> {
 
-  public RichText(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, boolean isLazy) {
-    super(instance, dom, parent, isLazy);
-  }
+    public RichText(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) {
+        super(instance, dom, parent);
+    }
 
-  @Override
-  protected void initView() {
-    mHost=new TextView(mContext);
-    ((TextView)mHost).setMovementMethod(LinkMovementMethod.getInstance());
-  }
+    @Override
+    protected TextView initComponentHostView(@NonNull Context context) {
+        TextView textView = new TextView(context);
+        textView.setTextSize(22);
+        textView.setTextColor(Color.BLACK);
+        return textView;
+    }
 
-  @WXComponentProp(name = "tel")
-  public void setTelLink(String tel){
-    SpannableString spannable=new SpannableString(tel);
-    spannable.setSpan(new URLSpan("tel:"+tel),0,tel.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-    ((TextView)mHost).setText(spannable);
-  }
+    @WXComponentProp(name = "tel")
+    public void setTel(String telNumber) {
+        getHostView().setText("tel: " + telNumber);
+    }
 }
 ```
 Register your Component:
 
 ```java
-WXSDKEngine.registerComponent("MyView",MyViewComponent.class);
+WXSDKEngine.registerComponent("richText", RichText.class);
 ```
 
 Use this component in weex DSL:
@@ -125,7 +125,7 @@ Use this component in weex DSL:
 ```html
 <template>
   <div>
-    <richText tel="12305" style="width:200;height:100">12305</text>
+    <richText tel="12305" style="width:200;height:100">12305</richText>
   </div>
 </template>
 ```
@@ -145,12 +145,12 @@ Use this component in weex DSL:
 
 ```html
 <template>
-  <mycomponent id='mycomponent'></mycomponent>
+  <mycomponent ref='mycomponent'></mycomponent>
 </template>
 <script>
   module.exports = {
     created: function() {
-      this.$el('mycomponent').focus();
+      this.$refs.mycomponent.focus();
     }
   }
 </script>


[3/4] incubator-weex-site git commit: Correct extend-android-en.md several errors (#93)

Posted by ha...@apache.org.
Correct extend-android-en.md several errors (#93)


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

Branch: refs/heads/master
Commit: 5b23ed18f2e52348139344477c60210deec574db
Parents: 3770be6 84ddbb4
Author: Hanks <zh...@gmail.com>
Authored: Fri Mar 9 21:48:52 2018 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Fri Mar 9 21:48:52 2018 +0800

----------------------------------------------------------------------
 source/guide/extend-android.md | 46 ++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-weex-site git commit: Correct some wrong links

Posted by ha...@apache.org.
Correct some wrong links

Correct who-is-using-weex.md some wrong links, please DO NOT add android apk download link as user may not want to download apk when click link.

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

Branch: refs/heads/master
Commit: 5b77f96aae1a8d60eda79042d7e62168e1b11d8b
Parents: c941b0d
Author: shikechen <80...@qq.com>
Authored: Fri Mar 9 17:40:24 2018 +0800
Committer: GitHub <no...@github.com>
Committed: Fri Mar 9 17:40:24 2018 +0800

----------------------------------------------------------------------
 source/_data/users.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/5b77f96a/source/_data/users.yml
----------------------------------------------------------------------
diff --git a/source/_data/users.yml b/source/_data/users.yml
index 15f2b3a..6d30191 100644
--- a/source/_data/users.yml
+++ b/source/_data/users.yml
@@ -52,7 +52,7 @@ taopiaopiao:
   name: '淘票票专业版'
   icon: 'https://gw.alicdn.com/tfs/TB1qB1RX_tYBeNjy1XdXXXXyVXa-512-512.png'
   iOS: 'https://itunes.apple.com/cn/app/id1211116737?mt=8'
-  android: 'https://appdownload.alicdn.com/publish/moviepro_android/latest/moviepro_android_700125.apk'
+  android: 'https://piaofang.taopiaopiao.com/pro/download/pc/index.html'
 hema:
   name: '盒马'
   icon: 'https://gw.alicdn.com/tfs/TB1dq38XQyWBuNjy0FpXXassXXa-144-144.png'
@@ -76,8 +76,8 @@ paytmmall:
 qierdianjing:
   name: '企鹅电竞'
   icon: 'https://img.alicdn.com/tfs/TB1jbs5XFOWBuNjy0FiXXXFxVXa-114-114.png'
-  iOS: 'https://app.kaola.com/'
-  android: 'http://dldir1.qq.com//egame/qgame/3.5.0/126/qgame_3.5.0.228.435_r13799_default_release.apk'
+  iOS: 'https://itunes.apple.com/cn/app/qi-e-dian-jing/id1111160472'
+  android: 'https://egame.qq.com/download'
 kaola:
   name: '网易考拉海购'
   icon: 'https://haitao.nos.netease.com/5c5f27c5-71f1-4f73-978d-e1f244bb4128.jpg'


[4/4] incubator-weex-site git commit: Correct some wrong links (#94)

Posted by ha...@apache.org.
Correct some wrong links (#94)


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

Branch: refs/heads/master
Commit: a08652002503baeb156c145ca5617f2967f70f37
Parents: 5b23ed1 5b77f96
Author: Hanks <zh...@gmail.com>
Authored: Fri Mar 9 21:52:31 2018 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Fri Mar 9 21:52:31 2018 +0800

----------------------------------------------------------------------
 source/_data/users.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------