You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/04/18 02:26:52 UTC

incubator-weex git commit: [WEEX-292][iOS] enable zIndex in cell component * [iOS] config zIndex of cell component

Repository: incubator-weex
Updated Branches:
  refs/heads/master ea2e12f94 -> 39c85a3e1


[WEEX-292][iOS] enable zIndex in cell component
* [iOS] config zIndex of cell component

* [iOS] support bounce for scrollerview

close #1116


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

Branch: refs/heads/master
Commit: 39c85a3e140a69763b50bccfb6a57612d6c0f132
Parents: ea2e12f
Author: acton393 <zh...@gmail.com>
Authored: Sun Apr 8 10:56:36 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Apr 18 10:24:22 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h     | 1 +
 ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m     | 3 +++
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.m     | 4 ++++
 ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 7 +++++++
 4 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
index fbae1d1..923af9d 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
@@ -44,5 +44,6 @@
 @property (nonatomic, assign) UITableViewRowAnimation deleteAnimation;
 @property (nonatomic, assign) BOOL keepScrollPosition;
 @property (nonatomic, weak) id<WXCellRenderDelegate> delegate;
+@property (nonatomic, strong) NSString *zIndex;
 
 @end

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
index 07621c7..b8feb31 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
@@ -46,6 +46,9 @@
         _keepScrollPosition = attributes[@"keepScrollPosition"] ? [WXConvert BOOL:attributes[@"keepScrollPosition"]] : NO;
         _lazyCreateView = YES;
         _isNeedJoinLayoutSystem = NO;
+        if (attributes[@"zIndex"]) {
+            _zIndex = [WXConvert NSString:attributes[@"zIndex"]];
+        }
     }
     
     return self;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index 39473e9..d73531c 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -705,6 +705,10 @@
     
     WXCellComponent *cell = [self cellForIndexPath:indexPath];
     
+    if (cell.zIndex) {
+        cellView.layer.zPosition = [WXConvert CGFloat:cell.zIndex];
+    }
+    
     if (!cell) {
         return cellView;
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/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 11aab36..f105444 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -82,6 +82,7 @@
     BOOL _scrollable;
     NSString * _alwaysScrollableVertical;
     NSString * _alwaysScrollableHorizontal;
+    BOOL _bounces;
     
     // refreshForAppear: load more when refresh component begin appear(if scroll is dragging or decelerating, should delay)
     // refreshForWholeVisible: load more until the whole refresh component visible
@@ -146,6 +147,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
         if (attributes[@"alwaysScrollableHorizontal"]) {
             _alwaysScrollableHorizontal = [WXConvert NSString:attributes[@"alwaysScrollableHorizontal"]];
         }
+        _bounces = attributes[@"bounce"]?[WXConvert BOOL:attributes[@"bounce"]]:YES;
         _refreshType = [WXConvert NSString:attributes[@"refreshType"]]?:@"refreshForWholeVisible";
         _pagingEnabled = attributes[@"pagingEnabled"] ? [WXConvert BOOL:attributes[@"pagingEnabled"]] : NO;
         _loadMoreOffset = attributes[@"loadmoreoffset"] ? [WXConvert WXPixelType:attributes[@"loadmoreoffset"] scaleFactor:self.weexInstance.pixelScaleFactor] : 0;
@@ -194,6 +196,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
     scrollView.showsHorizontalScrollIndicator = _showScrollBar;
     scrollView.scrollEnabled = _scrollable;
     scrollView.pagingEnabled = _pagingEnabled;
+    scrollView.bounces = _bounces;
     if (_alwaysScrollableHorizontal) {
         scrollView.alwaysBounceHorizontal = [WXConvert BOOL:_alwaysScrollableHorizontal];
     }
@@ -257,6 +260,10 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
     if (attributes[@"loadmoreoffset"]) {
         _loadMoreOffset = [WXConvert WXPixelType:attributes[@"loadmoreoffset"] scaleFactor:self.weexInstance.pixelScaleFactor];
     }
+    if (attributes[@"bounce"]) {
+        _bounces = [WXConvert BOOL:attributes[@"bounce"]];
+        ((UIScrollView *)self.view).bounces = _bounces;
+    }
     
     if (attributes[@"loadmoreretry"]) {
         NSUInteger loadmoreretry = [WXConvert NSUInteger:attributes[@"loadmoreretry"]];