* [ios] WXTransition fix bugs about how to deal with property

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

Branch: refs/heads/0.16-dev
Commit: 02658e32eead9f35e9dbe6b877bc9c8d06c08143
Parents: 741ee20
Author: doumafang <doumaf...@gmail.com>
Authored: Fri Aug 11 10:33:26 2017 +0800
Committer: doumafang <doumaf...@gmail.com>
Committed: Fri Aug 11 10:33:26 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/02658e32/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m 
b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index b8ae789..669603f 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -460,13 +460,27 @@
     BOOL yesOrNo = false;
     NSString *property = _styles[@"transitionProperty"];
     if (property) {
-        if ([property containsString:@"width"]||[property 
containsString:@"height"]||[property containsString:@"top"]||[property 
containsString:@"left"]||[property containsString:@"bottom"]||[property 
containsString:@"transform"]) {
+        if ([property containsString:@"width"]||[property 
containsString:@"height"]||[property containsString:@"top"]||[property 
containsString:@"bottom"]||[property containsString:@"right"]||[property 
containsString:@"left"]||[property containsString:@"transform"]||[property 
containsString:@"backgroundColor"]||[property containsString:@"opacity"]) {
             yesOrNo = true;
         }
     }
     return yesOrNo;
 }
 
+
+- (BOOL)_isPropertyAnimation
+{
+    BOOL yesOrNo = false;
+    NSString *property = _styles[@"transitionProperty"];
+    if (property) {
+        if ([property containsString:@"transform"]||[property 
containsString:@"backgroundColor"]||[property containsString:@"opacity"]) {
+            yesOrNo = true;
+        }
+    }
+    return yesOrNo;
+}
+
+
 - (void)_modifyStyles:(NSDictionary *)styles
 {
     pthread_mutex_lock(&_propertyMutex);
@@ -498,7 +512,9 @@
 - (void)_updateStylesOnMainThread:(NSDictionary *)styles 
resetStyles:(NSMutableArray *)resetStyles
 {
     WXAssertMainThread();
-    [self _updateViewStyles:styles];
+    if (![self _isPropertyAnimation]) {
+        [self _updateViewStyles:styles];
+    }
     [self _resetStyles:resetStyles];
     [self _handleBorders:styles isUpdating:YES];
     

Reply via email to