You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/03/02 03:28:48 UTC

[14/25] incubator-weex git commit: * [android] adapter scrollToElement with one arg

* [android] adapter scrollToElement with one arg


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

Branch: refs/heads/0.11-dev-recycler
Commit: 48d58d366530201d3d108c3dea85d78e56b00413
Parents: 4f2b772
Author: zshshr <zh...@gmail.com>
Authored: Fri Feb 24 18:21:07 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Fri Feb 24 18:21:07 2017 +0800

----------------------------------------------------------------------
 .../sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/48d58d36/android/sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java b/android/sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java
index 9444fa4..c52f071 100755
--- a/android/sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/dom/WXDomModule.java
@@ -347,7 +347,11 @@ public final class WXDomModule extends WXModule {
           if (args == null) {
             return null;
           }
-          scrollToElement((String) args.get(0), (JSONObject) args.get(1));
+          JSONObject option =null;
+          if(args.size()>1) {
+            option = (JSONObject) args.get(1);
+          }
+          scrollToElement((String) args.get(0),option);
           break;
         case ADD_RULE:
           if (args == null) {
@@ -609,7 +613,7 @@ public final class WXDomModule extends WXModule {
    * @param options scroll option, like {offset:0, duration:300}
    */
   public void scrollToElement(String ref, JSONObject options) {
-    if (TextUtils.isEmpty(ref) || options == null) {
+    if (TextUtils.isEmpty(ref) ) {
       return;
     }