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/16 11:55:50 UTC

[1/5] incubator-weex git commit: * [ios] fix pulling down event fire time

Repository: incubator-weex
Updated Branches:
  refs/heads/0.11-dev 00def9e22 -> e1a88b02d


* [ios] fix pulling down event fire time


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

Branch: refs/heads/0.11-dev
Commit: 374361f575abe0b567985393efe334a1ff1b2f33
Parents: d9907e9
Author: acton393 <zh...@gmail.com>
Authored: Thu Mar 16 11:04:10 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Mar 16 11:04:10 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/374361f5/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
index f931815..50dc059 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -436,14 +436,12 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
     _lastContentOffset = scrollView.contentOffset;
     
     CGFloat scaleFactor = self.weexInstance.pixelScaleFactor;
-    if ([_refreshComponent displayState] && scrollView.dragging) {
-        [_refreshComponent pullingdown:@{
+    [_refreshComponent pullingdown:@{
              REFRESH_DISTANCE_Y: @(fabs((scrollView.contentOffset.y - _lastContentOffset.y)/scaleFactor)),
              REFRESH_VIEWHEIGHT: @(_refreshComponent.view.frame.size.height/scaleFactor),
              REFRESH_PULLINGDISTANCE: @(scrollView.contentOffset.y/scaleFactor),
              @"type":@"pullingdown"
-         }];
-    }
+    }];
 
     // check sticky
     [self adjustSticky];


[2/5] incubator-weex git commit: * [ios] fix animation about bounds

Posted by cx...@apache.org.
* [ios] fix animation about bounds


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

Branch: refs/heads/0.11-dev
Commit: 21242dbd0d333ea3011d542c5e726bdaf6a438ce
Parents: 374361f
Author: acton393 <zh...@gmail.com>
Authored: Thu Mar 16 19:18:36 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Mar 16 19:18:36 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Module/WXAnimationModule.m  | 43 +++++++++++++++-----
 1 file changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/21242dbd/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
index 6cd4ad9..94ec6f0 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -23,6 +23,7 @@
 @property (nonatomic, assign) double duration;
 @property (nonatomic, assign) double delay;
 @property (nonatomic, strong) CAMediaTimingFunction *timingFunction;
+@property (nonatomic, assign) CGPoint originAnchorPoint;
 
 @end
 
@@ -84,11 +85,14 @@
         _animationInfo.target.view.layer.backgroundColor = (__bridge CGColorRef _Nullable)(_animationInfo.toValue);
     } else if ([_animationInfo.propertyName isEqualToString:@"opacity"]) {
         _animationInfo.target.view.layer.opacity = [_animationInfo.toValue floatValue];
-    } else if ([_animationInfo.propertyName isEqualToString:@"bounds"]) {
-        //set the layer bounds
-        if(strcmp([_animationInfo.toValue objCType], @encode(CGRect)) == 0) {
-            _animationInfo.target.view.layer.bounds = [_animationInfo.toValue CGRectValue];
+    } else if ([_animationInfo.propertyName hasPrefix:@"bounds.size"]) {
+        CGRect newBounds = _animationInfo.target.view.layer.bounds;
+        if ([_animationInfo.propertyName isEqualToString:@"bounds.size.width"]) {
+            newBounds.size = CGSizeMake([_animationInfo.toValue floatValue], newBounds.size.height);
+        }else if ([_animationInfo.propertyName isEqualToString:@"bounds.size.height"]) {
+            newBounds.size = CGSizeMake(newBounds.size.width,[_animationInfo.toValue floatValue]);
         }
+        _animationInfo.target.view.layer.bounds = newBounds;
     }
 }
 
@@ -98,6 +102,15 @@
         return;
     }
     
+    if ([_animationInfo.propertyName hasPrefix:@"bounds.size"]) {
+        /*
+         * http://ronnqvi.st/about-the-anchorpoint/
+         */
+        //
+        CGRect originFrame = _animationInfo.target.view.layer.frame;
+        _animationInfo.target.view.layer.anchorPoint = _animationInfo.originAnchorPoint;
+        _animationInfo.target.view.layer.frame = originFrame;
+    }
     [_animationInfo.target.layer removeAllAnimations];
     
     if (_finishBlock) {
@@ -212,18 +225,18 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:))
             info.toValue = @([value floatValue]);
             [infos addObject:info];
         } else if ([property isEqualToString:@"width"]) {
-            info.propertyName = @"bounds";
-            info.fromValue = [NSValue valueWithCGRect:layer.bounds];
+            info.propertyName = @"bounds.size.width";
+            info.fromValue = @(layer.bounds.size.width);
             CGRect newBounds = layer.bounds;
             newBounds.size = CGSizeMake([WXConvert WXPixelType:value scaleFactor:self.weexInstance.pixelScaleFactor], newBounds.size.height);
-            info.toValue = [NSValue valueWithCGRect:newBounds];
+            info.toValue = @(newBounds.size.width);
             [infos addObject:info];
         } else if ([property isEqualToString:@"height"]) {
-            info.propertyName = @"bounds";
-            info.fromValue = [NSValue valueWithCGRect:layer.bounds];
+            info.propertyName = @"bounds.size.height";
+            info.fromValue = @(layer.bounds.size.height);
             CGRect newBounds = layer.bounds;
             newBounds.size = CGSizeMake(newBounds.size.width, [WXConvert WXPixelType:value scaleFactor:self.weexInstance.pixelScaleFactor]);
-            info.toValue = [NSValue valueWithCGRect:newBounds];
+            info.toValue = @(newBounds.size.height);
             [infos addObject:info];
         }
     }
@@ -271,6 +284,16 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:))
     animation.delegate = delegate;
     
     CALayer *layer = info.target.layer;
+    if ([info.propertyName hasPrefix:@"bounds"]) {
+        info.originAnchorPoint = layer.anchorPoint;
+        CGRect originFrame = layer.frame;
+         /*
+          * if anchorPoint changed, the origin of layer's frame will change
+          * http://ronnqvi.st/about-the-anchorpoint/
+         */
+        layer.anchorPoint = CGPointZero;
+        layer.frame = originFrame;
+    }
     [layer addAnimation:animation forKey:info.propertyName];
 }
 


[3/5] incubator-weex git commit: * [ios] bug fix backgroundImage about gradientColor

Posted by cx...@apache.org.
* [ios] bug fix backgroundImage about gradientColor


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

Branch: refs/heads/0.11-dev
Commit: 93038dbfa325a7b3bab6aeec569e7bb95e9c3047
Parents: 21242db
Author: acton393 <zh...@gmail.com>
Authored: Thu Mar 16 19:25:44 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Mar 16 19:25:44 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m | 3 +++
 ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m           | 4 ++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93038dbf/ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m b/ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m
index 86c3379..fc16f91 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent+GradientColor.m
@@ -14,6 +14,9 @@
 @implementation  WXComponent (GradientColor)
 
 - (void)setGradientLayer {
+    if (CGRectEqualToRect(self.view.frame, CGRectZero)) {
+        return;
+    }
     //parse gradient-color, linear-gradient(to right, #a80077,rgba(200, 54, 54, 0.5))
     if ([_backgroundImage hasPrefix:@"linear-gradient"] && [_backgroundImage hasSuffix:@")"] ) {
         NSRange range = NSMakeRange(16, _backgroundImage.length - 17);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93038dbf/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
index ebed910..92c964b 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -13,6 +13,7 @@
 #import "WXComponent_internal.h"
 #import "WXSDKInstance_private.h"
 #import "WXComponent+BoxShadow.h"
+#import "WXComponent+GradientColor.h"
 
 @implementation WXComponent (Layout)
 
@@ -132,6 +133,9 @@
                 [strongSelf->_transform applyTransformForView:strongSelf.view];
             }
             
+            if (strongSelf->_backgroundImage) {
+                [strongSelf setGradientLayer];
+            }
             [strongSelf setNeedsDisplay];
         }];
     }


[5/5] incubator-weex git commit: Merge branch '0.11-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.11-dev

Posted by cx...@apache.org.
Merge branch '0.11-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.11-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/e1a88b02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e1a88b02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e1a88b02

Branch: refs/heads/0.11-dev
Commit: e1a88b02de9357aaee6d04be047b142c4bbe8ecc
Parents: 4c7ed69 00def9e
Author: cxfeng <cx...@apache.org>
Authored: Thu Mar 16 19:55:40 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Thu Mar 16 19:55:40 2017 +0800

----------------------------------------------------------------------
 android/sdk/libs/armeabi/libweexv8.so           | Bin 3583820 -> 3583820 bytes
 android/sdk/libs/x86/libweexv8.so               | Bin 4340864 -> 4336768 bytes
 .../com/taobao/weex/bridge/WXBridgeManager.java |  10 ++--------
 3 files changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[4/5] incubator-weex git commit: Merge branch '0.11-dev' of https://github.com/acton393/incubator-weex into 0.11-dev

Posted by cx...@apache.org.
Merge branch '0.11-dev' of https://github.com/acton393/incubator-weex into 0.11-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/4c7ed690
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4c7ed690
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4c7ed690

Branch: refs/heads/0.11-dev
Commit: 4c7ed6903dad847d56ccb112a5aaac3b5fb9f633
Parents: 80ddeae 93038db
Author: cxfeng <cx...@apache.org>
Authored: Thu Mar 16 19:55:16 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Thu Mar 16 19:55:16 2017 +0800

----------------------------------------------------------------------
 .../Component/WXComponent+GradientColor.m       |  3 ++
 .../Sources/Component/WXScrollerComponent.m     |  6 +--
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m |  4 ++
 .../WeexSDK/Sources/Module/WXAnimationModule.m  | 43 +++++++++++++++-----
 4 files changed, 42 insertions(+), 14 deletions(-)
----------------------------------------------------------------------