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/03 11:16:14 UTC

[1/2] incubator-weex git commit: * [ios] Be compatible with number value of transform-origin

Repository: incubator-weex
Updated Branches:
  refs/heads/0.11-dev-feature-recycler [created] 660a01ed9


* [ios] Be compatible with number value of transform-origin


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

Branch: refs/heads/0.11-dev-feature-recycler
Commit: 6776448d26ac71286a4be0da9a8a031ba6ad2637
Parents: 3cd8c25
Author: cxfeng <cx...@gmail.com>
Authored: Fri Mar 3 17:35:05 2017 +0800
Committer: cxfeng <cx...@gmail.com>
Committed: Fri Mar 3 17:35:05 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6776448d/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
index 3e0c7fc..686b341 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
@@ -100,7 +100,7 @@
     _visibility = styles[@"visibility"] ? [WXConvert WXVisibility:styles[@"visibility"]] : WXVisibilityShow;
     _positionType = styles[@"position"] ? [WXConvert WXPositionType:styles[@"position"]] : WXPositionTypeRelative;
     _transform = styles[@"transform"] || styles[@"transformOrigin"] ?
-    [[WXTransform alloc] initWithCSSValue:[WXConvert NSString:styles[@"transform"]] origin:styles[@"transformOrigin"] instance:self.weexInstance] :
+    [[WXTransform alloc] initWithCSSValue:[WXConvert NSString:styles[@"transform"]] origin:[WXConvert NSString:styles[@"transformOrigin"]] instance:self.weexInstance] :
     [[WXTransform alloc] initWithCSSValue:nil origin:nil instance:self.weexInstance];
     _boxShadow = styles[@"boxShadow"]?[WXConvert WXBoxShadow:styles[@"boxShadow"] scaleFactor:self.weexInstance.pixelScaleFactor]:nil;
     if (_boxShadow) {
@@ -172,7 +172,7 @@
     
     if (styles[@"transformOrigin"] || styles[@"transform"]) {
         id transform = styles[@"transform"] ? : self.styles[@"transform"];
-        id transformOrigin = styles[@"transformOrigin"] ? : self.styles[@"transformOrigin"];
+        id transformOrigin = styles[@"transformOrigin"] ? [WXConvert NSString:styles[@"transformOrigin"]] : [WXConvert NSString:self.styles[@"transformOrigin"]];
         _transform = [[WXTransform alloc] initWithCSSValue:[WXConvert NSString:transform] origin:transformOrigin instance:self.weexInstance];
         if (!CGRectEqualToRect(self.calculatedFrame, CGRectZero)) {
             [_transform applyTransformForView:_view];


[2/2] incubator-weex git commit: * [ios] add crash protect to recycler

Posted by cx...@apache.org.
* [ios] add crash protect to recycler


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

Branch: refs/heads/0.11-dev-feature-recycler
Commit: 660a01ed942a28d6eff710e591434aa3ef03e413
Parents: 6776448
Author: cxfeng <cx...@gmail.com>
Authored: Fri Mar 3 19:15:16 2017 +0800
Committer: cxfeng <cx...@gmail.com>
Committed: Fri Mar 3 19:15:16 2017 +0800

----------------------------------------------------------------------
 .../Sources/Component/Recycler/WXMultiColumnLayout.h        | 2 +-
 .../Sources/Component/Recycler/WXMultiColumnLayout.m        | 3 +++
 .../Sources/Component/Recycler/WXRecyclerUpdateController.m | 9 +++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/660a01ed/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
index c28180d..f107db0 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
@@ -27,7 +27,7 @@ extern NSString * const kCollectionSupplementaryViewKindHeader;
 
 @interface WXMultiColumnLayout : UICollectionViewLayout
 
-@property (nonatomic, assign) id<WXMultiColumnLayoutDelegate> delegate;
+@property (nonatomic, weak) id<WXMultiColumnLayoutDelegate> delegate;
 
 @property (nonatomic, strong) WXLength *columnCount;
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/660a01ed/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
index d6f9cdb..f5d641e 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
@@ -319,6 +319,9 @@ NSString * const kMultiColumnLayoutCell = @"WXMultiColumnLayoutCell";
     float columnWidth ;
     float availableWidth = self.contentWidth - (insets.left + insets.right);
     computeColumnWidthAndCount(availableWidth, self.columnCount, self.columnWidth, self.columnGap, &columnCount, &columnWidth);
+    if (availableWidth <= 0) {
+        return;
+    }
     WXAssert(columnCount > 0, @"invalid column count");
     WXAssert(columnWidth > 0, @"invalid column width");
     

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/660a01ed/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
index 17090b0..31c9dd0 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
@@ -87,6 +87,10 @@
 
 - (void)reloadItemsAtIndexPath:(NSIndexPath *)indexPath
 {
+    if (!indexPath) {
+        return;
+    }
+    
     if (!_reloadIndexPaths) {
         _reloadIndexPaths = [NSMutableSet set];
     }
@@ -143,8 +147,13 @@
     
     self.isUpdating = YES;
     
+    if (!self.delegate) {
+        return;
+    }
+    
     [self.delegate updateController:self willPerformUpdateWithNewData:newData];
     
+    NSLog(@"Diff result:%@", diffResult);
     [collectionView performBatchUpdates:updates completion:completion];
 }