You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2018/06/27 07:13:00 UTC

[2/2] incubator-weex git commit: * [Android] Fix duplication of animation initialization due to transformOrigin of CSS

* [Android] Fix duplication of animation initialization due to transformOrigin of CSS

http://dotwe.org/vue/c793e8f291dba9ab7ba660d07b0644e6


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

Branch: refs/heads/master
Commit: 709d7803601cf3bccaa6997b2fb2d12551e1b0be
Parents: 7490d74
Author: YorkShen <sh...@gmail.com>
Authored: Wed Jun 27 14:20:35 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Wed Jun 27 15:12:48 2018 +0800

----------------------------------------------------------------------
 .../taobao/weex/ui/action/GraphicActionAnimation.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/709d7803/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionAnimation.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionAnimation.java b/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionAnimation.java
index c8b0a04..fbbb906 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionAnimation.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionAnimation.java
@@ -61,6 +61,8 @@ public class GraphicActionAnimation extends BasicGraphicAction {
 
   private final static String TAG = "GraphicActionAnimation";
 
+  private final boolean styleNeedInit;
+
   @Nullable
   private
   final String callback;
@@ -71,6 +73,7 @@ public class GraphicActionAnimation extends BasicGraphicAction {
 
   public GraphicActionAnimation(@NonNull String pageId, @NonNull String ref, @NonNull WXAnimationBean animationBean) {
     super(pageId, ref);
+    this.styleNeedInit = false;
     this.callback = null;
     this.mAnimationBean = animationBean;
   }
@@ -78,6 +81,7 @@ public class GraphicActionAnimation extends BasicGraphicAction {
   public GraphicActionAnimation(@NonNull String pageId, @NonNull String ref, @Nullable String animation,
                                 @Nullable final String callBack) {
     super(pageId, ref);
+    this.styleNeedInit = true;
     this.callback = callBack;
     if (!TextUtils.isEmpty(animation)) {
       this.mAnimationBean = JSONObject.parseObject(animation, WXAnimationBean.class);
@@ -86,6 +90,7 @@ public class GraphicActionAnimation extends BasicGraphicAction {
   public GraphicActionAnimation(@NonNull String pageId, @NonNull String ref, @NonNull WXAnimationBean animationBean,
                                 @Nullable final String callBack) {
     super(pageId, ref);
+    this.styleNeedInit = false;
     this.mAnimationBean = animationBean;
     this.callback = callBack;
   }
@@ -107,9 +112,12 @@ public class GraphicActionAnimation extends BasicGraphicAction {
     }
 
     if (null != mAnimationBean.styles) {
-      mAnimationBean.styles.init(mAnimationBean.styles.transformOrigin,
-              mAnimationBean.styles.transform, (int) component.getLayoutWidth(), (int) component.getLayoutHeight(),
-              instance.getInstanceViewPortWidth());
+      if(styleNeedInit) {
+        mAnimationBean.styles.init(mAnimationBean.styles.transformOrigin,
+            mAnimationBean.styles.transform, (int) component.getLayoutWidth(),
+            (int) component.getLayoutHeight(),
+            instance.getInstanceViewPortWidth());
+      }
       startAnimation(instance, component);
     }
   }