weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cxf...@apache.org
Subject [12/25] incubator-weex git commit: * [ios] support cell move and remove
Date Thu, 02 Mar 2017 03:28:46 GMT
* [ios] support cell move and remove


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

Branch: refs/heads/0.11-dev-recycler
Commit: 4c8127ce0290066765c85f829f63d4afa91aaf17
Parents: 202321a
Author: 隐风 <cxfeng1@gmail.com>
Authored: Thu Feb 23 19:59:53 2017 +0800
Committer: 隐风 <cxfeng1@gmail.com>
Committed: Thu Feb 23 19:59:53 2017 +0800

----------------------------------------------------------------------
 .../Component/Recycler/WXRecyclerComponent.m      | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4c8127ce/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
index f4cf51e..d7e1fac 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
@@ -273,7 +273,7 @@ typedef enum : NSUInteger {
 
 - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
 {
-    WXLogError(@"section number:%zi", [self.dataController numberOfSections]);
+    WXLogDebug(@"section number:%zi", [self.dataController numberOfSections]);
     return [self.dataController numberOfSections];
 }
 
@@ -414,12 +414,24 @@ typedef enum : NSUInteger {
 
 - (void)cellDidRemove:(WXCellComponent *)cell
 {
-    
+    if (cell.isLayoutComplete) {
+        WXPerformBlockOnMainThread(^{
+            [self.collectionView.collectionViewLayout invalidateLayout];
+            [self performUpdatesWithCompletion:^(BOOL finished) {
+            }];
+        });
+    }
 }
 
 - (void)cell:(WXCellComponent *)cell didMoveToIndex:(NSUInteger)index
 {
-    
+    if (cell.isLayoutComplete) {
+        WXPerformBlockOnMainThread(^{
+            [self.collectionView.collectionViewLayout invalidateLayout];
+            [self performUpdatesWithCompletion:^(BOOL finished) {
+            }];
+        });
+    }
 }
 
 #pragma makrk - private


Mime
View raw message