You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/15 05:53:11 UTC

[1/8] incubator-weex git commit: * [android] parallax multiple scroller binding

Repository: incubator-weex
Updated Branches:
  refs/heads/dev 5b3a2558a -> 92399a4ad


* [android] parallax multiple scroller binding


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

Branch: refs/heads/dev
Commit: 087660929cf4c89f6ae42258a22150767a934ce5
Parents: 1216f81
Author: zshshr <zh...@gmail.com>
Authored: Tue Jun 6 10:23:51 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Jun 6 10:23:51 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/common/ICheckBindingScroller.java  |  9 +++++++++
 .../java/com/taobao/weex/ui/component/WXComponent.java | 11 +++++++++++
 .../java/com/taobao/weex/ui/component/WXScroller.java  |  9 ++++++++-
 .../com/taobao/weex/ui/component/WXVContainer.java     | 13 +++++++++++++
 .../weex/ui/component/list/BasicListComponent.java     |  9 ++++++++-
 5 files changed, 49 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08766092/android/sdk/src/main/java/com/taobao/weex/common/ICheckBindingScroller.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/common/ICheckBindingScroller.java b/android/sdk/src/main/java/com/taobao/weex/common/ICheckBindingScroller.java
new file mode 100644
index 0000000..967869d
--- /dev/null
+++ b/android/sdk/src/main/java/com/taobao/weex/common/ICheckBindingScroller.java
@@ -0,0 +1,9 @@
+package com.taobao.weex.common;
+
+/**
+ * Created by zhengshihan on 2017/6/5.
+ */
+
+public interface ICheckBindingScroller {
+  boolean isNeedScroller(String ref,Object option);
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08766092/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index 659cb16..ba12251 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -850,6 +850,17 @@ public abstract class  WXComponent<T extends View> implements IWXObject, IWXActi
     }
   }
 
+  /**
+   * get Scroller components
+   */
+  @Nullable
+  public Scrollable getFirstScroller() {
+   if(this instanceof Scrollable){
+     return (Scrollable)this;
+   }
+   return null;
+  }
+
   public WXVContainer getParent() {
     return mParent;
   }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08766092/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
index ca2e174..24e4940 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
@@ -37,6 +37,7 @@ import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.annotation.Component;
 import com.taobao.weex.annotation.JSMethod;
 import com.taobao.weex.common.Constants;
+import com.taobao.weex.common.ICheckBindingScroller;
 import com.taobao.weex.common.OnWXScrollListener;
 import com.taobao.weex.common.WXThread;
 import com.taobao.weex.dom.WXDomObject;
@@ -397,7 +398,13 @@ public class WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewL
           if(listeners!=null && listeners.size()>0){
             for (OnWXScrollListener listener : listeners) {
               if (listener != null) {
-                listener.onScrolled(scrollView, x, y);
+                if(listener instanceof ICheckBindingScroller){
+                  if(((ICheckBindingScroller) listener).isNeedScroller(getRef(),null)){
+                    listener.onScrolled(scrollView, x, y);
+                  }
+                }else {
+                  listener.onScrolled(scrollView, x, y);
+                }
               }
             }
           }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08766092/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
index 2e75f31..afdad86 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
@@ -126,6 +126,19 @@ public abstract class WXVContainer<T extends ViewGroup> extends WXComponent<T> {
   }
 
 
+  public Scrollable getFirstScroller(){
+    if(this instanceof Scrollable){
+      return (Scrollable)this;
+    }else{
+      for (int i=0;i<getChildCount();i++){
+        Scrollable scrollable = getChild(i).getFirstScroller();
+        if(scrollable!=null){
+          return scrollable;
+        }
+      }
+    }
+    return null;
+  }
   @Override
   public void bindData(WXComponent component) {
     if(!isLazy()) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08766092/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index efe9147..0d60fb9 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -43,6 +43,7 @@ import com.taobao.weex.WXEnvironment;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.annotation.JSMethod;
 import com.taobao.weex.common.Constants;
+import com.taobao.weex.common.ICheckBindingScroller;
 import com.taobao.weex.common.OnWXScrollListener;
 import com.taobao.weex.dom.ImmutableDomObject;
 import com.taobao.weex.dom.WXDomObject;
@@ -273,7 +274,13 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
         if (listeners != null && listeners.size() > 0) {
           for (OnWXScrollListener listener : listeners) {
             if (listener != null) {
-              listener.onScrolled(recyclerView, dx, dy);
+              if(listener instanceof ICheckBindingScroller){
+                if(((ICheckBindingScroller) listener).isNeedScroller(getRef(),null)){
+                  listener.onScrolled(recyclerView, dx, dy);
+                }
+              }else {
+                listener.onScrolled(recyclerView, dx, dy);
+              }
             }
           }
         }


[4/8] incubator-weex git commit: fix dingding crash Fix 32bit put by value operation array mode selection bug. This is caused by value profile data is changed during fast case and slow case.

Posted by so...@apache.org.
 fix dingding crash
 Fix 32bit put by value operation array mode selection bug.
 This is caused by value profile data is changed during fast case and slow case.


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

Branch: refs/heads/dev
Commit: 149d3ea429ab867ae54aacd30b31725f30fbee26
Parents: b24f1ab
Author: 御魂 <we...@alibaba-inc.com>
Authored: Fri Jun 9 18:14:46 2017 +0800
Committer: 御魂 <we...@alibaba-inc.com>
Committed: Fri Jun 9 18:14:46 2017 +0800

----------------------------------------------------------------------
 android/sdk/libs/armeabi/libweexjsc.so | Bin 7566292 -> 7570392 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/149d3ea4/android/sdk/libs/armeabi/libweexjsc.so
----------------------------------------------------------------------
diff --git a/android/sdk/libs/armeabi/libweexjsc.so b/android/sdk/libs/armeabi/libweexjsc.so
index bf73161..cb0f6b6 100755
Binary files a/android/sdk/libs/armeabi/libweexjsc.so and b/android/sdk/libs/armeabi/libweexjsc.so differ


[7/8] incubator-weex git commit: Merge branch '0.13-dev' of gitlab.alibaba-inc.com:weex/weex into 0.13-dev

Posted by so...@apache.org.
Merge branch '0.13-dev' of gitlab.alibaba-inc.com:weex/weex into 0.13-dev


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

Branch: refs/heads/dev
Commit: 005b74a2c7a6496edf27bf0418147fa0c8576861
Parents: 4d2a91b 8628cdd
Author: sospartan <so...@apache.org>
Authored: Thu Jun 15 13:49:33 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu Jun 15 13:49:33 2017 +0800

----------------------------------------------------------------------
 android/sdk/libs/armeabi/libweexjsc.so | Bin 7566292 -> 7570392 bytes
 android/sdk/libs/x86/libweexjsc.so     | Bin 4545544 -> 12121924 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------



[2/8] incubator-weex git commit: + [android] add parallax component as demo

Posted by so...@apache.org.
+ [android] add parallax component as demo


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

Branch: refs/heads/dev
Commit: 53cf474a2944d1ecbd2bdc4158557d1665b9aabb
Parents: 0876609
Author: zshshr <zh...@gmail.com>
Authored: Tue Jun 6 10:24:42 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Jun 6 10:24:42 2017 +0800

----------------------------------------------------------------------
 .../java/com/alibaba/weex/WXApplication.java    |   2 +
 .../weex/extend/component/WXParallax.java       | 345 +++++++++++++++++++
 2 files changed, 347 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/53cf474a/android/playground/app/src/main/java/com/alibaba/weex/WXApplication.java
----------------------------------------------------------------------
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/WXApplication.java b/android/playground/app/src/main/java/com/alibaba/weex/WXApplication.java
index 283a44f..561d292 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/WXApplication.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/WXApplication.java
@@ -30,6 +30,7 @@ import com.alibaba.weex.extend.adapter.InterceptWXHttpAdapter;
 import com.alibaba.weex.extend.component.RichText;
 import com.alibaba.weex.extend.component.WXComponentSyncTest;
 import com.alibaba.weex.extend.component.WXMask;
+import com.alibaba.weex.extend.component.WXParallax;
 import com.alibaba.weex.extend.component.dom.WXMaskDomObject;
 import com.alibaba.weex.extend.module.GeolocationModule;
 import com.alibaba.weex.extend.module.MyModule;
@@ -75,6 +76,7 @@ public class WXApplication extends Application {
     try {
       Fresco.initialize(this);
       WXSDKEngine.registerComponent("synccomponent", WXComponentSyncTest.class);
+      WXSDKEngine.registerComponent(WXParallax.PARALLAX, WXParallax.class);
 
       WXSDKEngine.registerComponent("richtext", RichText.class);
       WXSDKEngine.registerModule("render", RenderModule.class);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/53cf474a/android/playground/app/src/main/java/com/alibaba/weex/extend/component/WXParallax.java
----------------------------------------------------------------------
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/extend/component/WXParallax.java b/android/playground/app/src/main/java/com/alibaba/weex/extend/component/WXParallax.java
new file mode 100644
index 0000000..7cceebc
--- /dev/null
+++ b/android/playground/app/src/main/java/com/alibaba/weex/extend/component/WXParallax.java
@@ -0,0 +1,345 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.alibaba.weex.extend.component;
+
+import android.graphics.Color;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.Animation;
+import android.view.animation.AnimationSet;
+import android.view.animation.RotateAnimation;
+import android.view.animation.ScaleAnimation;
+import android.view.animation.TranslateAnimation;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.taobao.weex.WXEnvironment;
+import com.taobao.weex.WXSDKInstance;
+import com.taobao.weex.common.Constants;
+import com.taobao.weex.common.ICheckBindingScroller;
+import com.taobao.weex.common.OnWXScrollListener;
+import com.taobao.weex.dom.WXDomObject;
+import com.taobao.weex.ui.animation.WXAnimationBean;
+import com.taobao.weex.ui.component.Scrollable;
+import com.taobao.weex.ui.component.WXComponent;
+import com.taobao.weex.ui.component.WXDiv;
+import com.taobao.weex.ui.component.WXVContainer;
+import com.taobao.weex.utils.WXLogUtils;
+import com.taobao.weex.utils.WXResourceUtils;
+
+import java.util.ArrayList;
+
+
+/**
+ * Created by zhengshihan on 2017/5/3.
+ */
+
+public class WXParallax extends WXDiv implements OnWXScrollListener, ICheckBindingScroller {
+
+  public final static String WX_TRANSFORM = "transform";
+  public final static String WX_OPACITY = "opacity";
+  public static final String PARALLAX = "parallax";
+  public static final String BINDING_SCROLLER = "bindingScroller";
+
+
+  ArrayList<TransformCreator> mTransformPropArrayList = new ArrayList<>();
+  BackgroundColorCreator mBackgroundColor;
+  String mBindingRef = "";
+
+  private int mBackGroundColor = 0;
+  private float mOffsetY = 0;
+
+  public WXParallax(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) {
+    super(instance, dom, parent);
+    initTransform(dom.getAttrs().get(WX_TRANSFORM));
+    initOpacity(dom.getAttrs().get(Constants.Name.OPACITY));
+    initBackgroundColor(dom.getAttrs().get(Constants.Name.BACKGROUND_COLOR));
+
+    mBindingRef = (String) (dom.getAttrs().get(BINDING_SCROLLER));
+    instance.registerOnWXScrollListener(this);
+  }
+
+
+  private void initBackgroundColor(Object obj) {
+    if (obj == null)
+      return;
+
+    if (obj instanceof JSONObject) {
+      mBackgroundColor = new BackgroundColorCreator();
+      JSONObject object = (JSONObject) obj;
+
+      JSONArray in = object.getJSONArray("in");
+      mBackgroundColor.input = new int[in.size()];
+      for (int i = 0; i < in.size(); i++) {
+        mBackgroundColor.input[i] = in.getInteger(i);
+      }
+
+      JSONArray out = object.getJSONArray("out");
+      mBackgroundColor.output = new int[out.size()];
+      for (int i = 0; i < out.size(); i++) {
+        String colorStr = out.getString(i);
+        mBackgroundColor.output[i] = WXResourceUtils.getColor(colorStr);
+      }
+    }
+  }
+
+  private void initOpacity(Object obj) {
+    if (obj == null)
+      return;
+
+    if (obj instanceof JSONObject) {
+      mTransformPropArrayList.add(new TransformCreator(WX_OPACITY, (JSONObject) obj));
+    }
+
+  }
+
+  private void initTransform(Object propStr) {
+
+    if (propStr == null) {
+      WXLogUtils.w("WXParallax initAnimation propStr ==null");
+      return;
+    }
+    JSONArray jsonObject;
+    if (propStr instanceof JSONArray) {
+      jsonObject = (JSONArray) propStr;
+      for (int i = 0; i < jsonObject.size(); i++) {
+        JSONObject object = jsonObject.getJSONObject(i);
+        mTransformPropArrayList.add(i,
+            new TransformCreator(object.getString("type"), object));
+      }
+    }
+  }
+
+  @Override
+  public boolean isNeedScroller(String ref, Object option) {
+
+    mBindingRef = (String) (getDomObject().getAttrs().get(BINDING_SCROLLER));
+    if (TextUtils.isEmpty(mBindingRef)) {
+      WXComponent root = getInstance().getRootComponent();
+      if (root != null && root instanceof WXVContainer) {
+        Scrollable scrollable = root.getFirstScroller();
+        if (scrollable != null) {
+          mBindingRef = scrollable.getRef();
+        }
+      }
+    }
+    if (!TextUtils.isEmpty(mBindingRef)
+        && !TextUtils.isEmpty(ref)
+        && ref.equals(mBindingRef)) {
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public void onScrolled(View view, int dx, int dy) {
+
+    mOffsetY = mOffsetY + dy;
+
+    AnimationSet animationSet = new AnimationSet(true);
+    boolean hasAnimation = false;
+    for (int i = 0; i < mTransformPropArrayList.size(); i++) {
+      TransformCreator creator = mTransformPropArrayList.get(i);
+      Animation animation = creator.getAnimation(dx, dy);
+      if (animation != null) {
+        animationSet.addAnimation(animation);
+        hasAnimation = true;
+      }
+    }
+
+    if (hasAnimation) {
+      animationSet.setFillAfter(true);
+      if (getHostView() != null) {
+        getHostView().startAnimation(animationSet);
+      }
+    }
+
+    if (mBackgroundColor != null) {
+      int color = mBackgroundColor.getColor(dx, dy);
+      if (mBackGroundColor != color) {
+        getHostView().setBackgroundColor(color);
+        mBackGroundColor = color;
+      }
+    }
+  }
+
+  @Override
+  public void onScrollStateChanged(View view, int x, int y, int newState) {
+
+  }
+
+
+  private class BackgroundColorCreator {
+
+    int[] input;
+    int[] output;
+
+    int getColor(int XDelta, int YDelta) {
+      if (WXEnvironment.isApkDebugable()) {
+        WXLogUtils.d("WXParallax:getColor: XDelta" + XDelta + " YDelta:" + YDelta + " mOffsetY" + mOffsetY);
+      }
+      int r1, g1, b1;
+
+      if (mOffsetY > input[1]) {
+        return output[1];
+      }
+
+      if (mOffsetY < input[0]) {
+        return output[0];
+      }
+
+      r1 = Color.red(output[0]) + (int) (mOffsetY - input[0]) * (Color.red(output[1]) - Color.red(output[0])) / (input[1] - input[0]);
+      g1 = Color.green(output[0]) + (int) (mOffsetY - input[0]) * (Color.green(output[1]) - Color.green(output[0])) / (input[1] - input[0]);
+      b1 = Color.blue(output[0]) + (int) (mOffsetY - input[0]) * (Color.blue(output[1]) - Color.blue(output[0])) / (input[1] - input[0]);
+
+      if (WXEnvironment.isApkDebugable()) {
+        WXLogUtils.d("WXParallax:getColor: r1" + r1 + " g1:" + g1 + " b1:" + b1);
+      }
+      return Color.rgb(r1, g1, b1);
+    }
+
+  }
+
+  private class TransformCreator {
+
+    String transformType;
+    float[] input, output;
+    float fromTranslateX, fromTranslateY;
+    float fromScaleX, fromScaleY;
+    float fromRotate, fromOpacity;
+
+    TransformCreator(String type, JSONObject object) {
+      transformType = type;
+      JSONArray in = object.getJSONArray("in");
+      input = parseParamArray(in);
+      JSONArray out = object.getJSONArray("out");
+      output = parseParamArray(out);
+
+      switch (transformType) {
+        case WXAnimationBean.Style.WX_TRANSLATE:
+          fromTranslateX = output[0];
+          fromTranslateY = output[1];
+          break;
+        case WXAnimationBean.Style.WX_SCALE:
+          fromScaleX = output[0];
+          fromScaleY = output[1];
+          break;
+        case WXAnimationBean.Style.WX_ROTATE:
+          fromRotate = output[0];
+          break;
+        case WX_OPACITY:
+          fromOpacity = output[0];
+          break;
+      }
+    }
+
+    float[] parseParamArray(JSONArray in) {
+
+      int size = in.size();
+      float[] param = new float[size];
+      for (int j = 0; j < size; j++) {
+        param[j] = in.getFloatValue(j);
+      }
+      return param;
+    }
+
+
+    @Nullable
+    Animation getAnimation(float XDelta, float YDelta) {
+
+      float offset = mOffsetY;
+      if (offset > input[1]) {
+        offset = input[1];
+      }
+      if (offset < input[0]) {
+        offset = input[0];
+      }
+      float toTranslateX, toTranslateY, toOpacity, toScaleX, toScaleY, toRotate;
+      Animation animation = null;
+
+      if (WXEnvironment.isApkDebugable()) {
+        WXLogUtils.d("WXParallax", "type:" + transformType + " XDelta:" + XDelta + " YDelta:" + YDelta);
+      }
+      switch (transformType) {
+
+        case WXAnimationBean.Style.WX_TRANSLATE:
+          toTranslateX = output[0] + (output[2] - output[0]) * (offset - input[0]) / (input[1] - input[0]);
+          toTranslateY = output[1] + (output[3] - output[1]) * (offset - input[0]) / (input[1] - input[0]);
+
+          if (fromTranslateX == toTranslateX && fromTranslateY == toTranslateY) {
+            return null;
+          }
+          animation = new TranslateAnimation(fromTranslateX, toTranslateX, fromTranslateY, toTranslateY);
+
+          fromTranslateX = toTranslateX;
+          fromTranslateY = toTranslateY;
+
+          if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.d("WXParallax", "XDelta:" + XDelta + " YDelta:" + YDelta);
+            WXLogUtils.d("WXParallax", " fromTranslateX:" + fromTranslateX + " toTranslateX:" + toTranslateX + " fromTranslateY:" + fromTranslateY + " toTranslateY:" + toTranslateY);
+          }
+
+          break;
+        case WXAnimationBean.Style.WX_SCALE:
+          toScaleX = output[0] + (output[2] - output[0]) * (offset - input[0]) / (input[1] - input[0]);
+          toScaleY = output[1] + (output[3] - output[1]) * (offset - input[0]) / (input[1] - input[0]);
+
+          if (fromScaleX == toScaleX && fromScaleY == toScaleY) {
+            return null;
+          }
+          animation = new ScaleAnimation(fromScaleX, toScaleX, fromScaleY, toScaleY);
+
+          if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.d("WXParallax", " fromScaleX:" + fromScaleX + " toScaleX:" + toScaleX + " fromScaleY:" + fromScaleY + " toScaleY:" + toScaleY);
+          }
+
+          fromScaleX = toScaleX;
+          fromScaleY = toScaleY;
+          break;
+
+        case WXAnimationBean.Style.WX_ROTATE:
+          toRotate = output[0] + (output[1] - output[0]) * (offset - input[0]) / (input[1] - input[0]);
+          if (fromRotate == toRotate) {
+            return null;
+          }
+          animation = new RotateAnimation(fromRotate, toRotate, output[2], output[3]);
+          fromRotate = toRotate;
+          break;
+
+        case WX_OPACITY:
+          toOpacity = output[0] + (output[1] - output[0]) * (offset - input[0]) / (input[1] - input[0]);
+          if (fromOpacity == toOpacity) {
+            return null;
+          }
+          animation = new AlphaAnimation(fromOpacity, toOpacity);
+
+          if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.d("WXParallax", "opacity fromOpacity:" + fromOpacity + " toOpacity:" + toOpacity);
+          }
+
+          fromOpacity = toOpacity;
+          break;
+      }
+
+      return animation;
+    }
+  }
+}


[6/8] incubator-weex git commit: * [android] remove some reference of DomObject on input

Posted by so...@apache.org.
* [android] remove some reference of DomObject on input


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

Branch: refs/heads/dev
Commit: 4d2a91bbbbfa639533960332c1566f98252b1a8b
Parents: 2b43dc5
Author: moxun.ljf <fu...@foxmail.com>
Authored: Mon Jun 12 16:10:06 2017 +0800
Committer: moxun.ljf <fu...@foxmail.com>
Committed: Mon Jun 12 16:10:06 2017 +0800

----------------------------------------------------------------------
 .../ui/component/AbstractEditComponent.java     | 33 +++++++-------------
 1 file changed, 11 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4d2a91bb/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
index 84c42dc..bf8935e 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
@@ -41,7 +41,6 @@ import com.taobao.weex.WXSDKManager;
 import com.taobao.weex.annotation.JSMethod;
 import com.taobao.weex.bridge.WXBridgeManager;
 import com.taobao.weex.common.Constants;
-import com.taobao.weex.dom.ImmutableDomObject;
 import com.taobao.weex.dom.WXDomObject;
 import com.taobao.weex.dom.WXStyle;
 import com.taobao.weex.ui.component.helper.SoftKeyboardDetector;
@@ -155,8 +154,6 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
     }
 
     editText.setTextSize(TypedValue.COMPLEX_UNIT_PX, WXStyle.getFontSize(getDomObject().getStyles(),getInstance().getInstanceViewPortWidth()));
-    editText.setText(getDomObject().getAttrs().optString(Constants.Name.VALUE));
-    mIgnoreNextOnInputEvent = true;
   }
 
 
@@ -172,19 +169,13 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
       addFocusChangeListener(new OnFocusChangeListener() {
         @Override
         public void onFocusChange(boolean hasFocus) {
-          ImmutableDomObject domObject = getDomObject();
-          if(domObject == null){
-            return;
-          }
-
           if (hasFocus) {
             mLastValue = text.getText().toString();
           } else {
             CharSequence newValue = text.getText();
             newValue = newValue == null ? "" : newValue;
             if (!newValue.toString().equals(mLastValue)) {
-              String event = domObject.getEvents().contains(Constants.Event.CHANGE) ? Constants.Event.CHANGE : null;
-              fireEvent(event, newValue.toString());
+              fireEvent(Constants.Event.CHANGE, newValue.toString());
               mLastValue = text.getText().toString();
             }
           }
@@ -194,13 +185,11 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
       addEditorActionListener(new TextView.OnEditorActionListener() {
         @Override
         public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-          ImmutableDomObject domObject = getDomObject();
-          if (domObject != null && actionId == mEditorAction) {
+          if (actionId == mEditorAction) {
             CharSequence newValue = text.getText();
             newValue = newValue == null ? "" : newValue;
             if (!newValue.toString().equals(mLastValue)) {
-              String eventName = domObject.getEvents().contains(Constants.Event.CHANGE) ? Constants.Event.CHANGE : null;
-              fireEvent(eventName, newValue.toString());
+              fireEvent(Constants.Event.CHANGE, newValue.toString());
               mLastValue = text.getText().toString();
             }
             if (getParent() != null) {
@@ -221,8 +210,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
 
         @Override
         public void onTextChanged(CharSequence s, int start, int before, int count) {
-          ImmutableDomObject domObject = getDomObject();
-          if (mBeforeText.equals(s.toString()) || domObject == null) {
+          if (mBeforeText.equals(s.toString())) {
             return;
           }
 
@@ -233,8 +221,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
             return;
           }
 
-          String event = domObject.getEvents().contains(Constants.Event.INPUT) ? Constants.Event.INPUT : null;
-          fireEvent(event, s.toString());
+          fireEvent(Constants.Event.INPUT, s.toString());
         }
 
         @Override
@@ -281,8 +268,10 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
   }
 
   public void performOnChange(String value) {
-    String event = getDomObject().getEvents().contains(Constants.Event.CHANGE) ? Constants.Event.CHANGE : null;
-    fireEvent(event, value);
+    if (getDomObject() != null && getDomObject().getEvents() != null) {
+      String event = getDomObject().getEvents().contains(Constants.Event.CHANGE) ? Constants.Event.CHANGE : null;
+      fireEvent(event, value);
+    }
   }
 
   @Override
@@ -447,9 +436,9 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
       return;
     }
 
-    view.setText(value);
-    view.setSelection(value == null?0:value.length());
     mIgnoreNextOnInputEvent = true;
+    view.setText(value);
+    view.setSelection(value == null ? 0 : value.length());
   }
 
   @WXComponentProp(name = Constants.Name.COLOR)


[8/8] incubator-weex git commit: Merge branch '0.13-dev' into dev

Posted by so...@apache.org.
Merge branch '0.13-dev' into dev


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

Branch: refs/heads/dev
Commit: 92399a4ad69f9f2445c36747721c4f4f5d1afbda
Parents: 5b3a255 005b74a
Author: sospartan <so...@apache.org>
Authored: Thu Jun 15 13:52:56 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu Jun 15 13:52:56 2017 +0800

----------------------------------------------------------------------
 android/sdk/libs/armeabi/libweexjsc.so          | Bin 7566292 -> 7570392 bytes
 android/sdk/libs/x86/libweexjsc.so              | Bin 4545544 -> 12121924 bytes
 .../ui/component/AbstractEditComponent.java     |  33 +++++++------------
 3 files changed, 11 insertions(+), 22 deletions(-)
----------------------------------------------------------------------



[5/8] incubator-weex git commit: jsc X86 platform support

Posted by so...@apache.org.
 jsc X86 platform support


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

Branch: refs/heads/dev
Commit: 8628cdd7f6da790c36fdaae684fbea88d17be833
Parents: 149d3ea
Author: 御魂 <we...@alibaba-inc.com>
Authored: Fri Jun 9 18:49:27 2017 +0800
Committer: 御魂 <we...@alibaba-inc.com>
Committed: Fri Jun 9 18:49:27 2017 +0800

----------------------------------------------------------------------
 android/sdk/libs/x86/libweexjsc.so | Bin 4545544 -> 12121924 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8628cdd7/android/sdk/libs/x86/libweexjsc.so
----------------------------------------------------------------------
diff --git a/android/sdk/libs/x86/libweexjsc.so b/android/sdk/libs/x86/libweexjsc.so
index d60dce1..83ef452 100755
Binary files a/android/sdk/libs/x86/libweexjsc.so and b/android/sdk/libs/x86/libweexjsc.so differ


[3/8] incubator-weex git commit: * [android] enlarge LOW_MEM_VALUE to avoid crash

Posted by so...@apache.org.
* [android] enlarge LOW_MEM_VALUE to avoid crash


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

Branch: refs/heads/dev
Commit: b24f1ab7e89002bc0268884a8c306e1a4b7091fe
Parents: 53cf474
Author: zshshr <zh...@gmail.com>
Authored: Tue Jun 6 10:25:34 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Jun 6 10:25:34 2017 +0800

----------------------------------------------------------------------
 .../sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b24f1ab7/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 6a745f6..b8f68fa 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
@@ -117,7 +117,7 @@ public class WXBridgeManager implements Callback,BactchExecutor {
 
   private static final int INIT_FRAMEWORK_OK = 1;
 
-  private static long LOW_MEM_VALUE = 80;
+  private static long LOW_MEM_VALUE = 120;
 
   static volatile WXBridgeManager mBridgeManager;