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/03 07:48:10 UTC

[1/2] incubator-weex git commit: fix the bug of [WEEX-271][iOS] Extend the pulldown WXRefreshComponent to support immediate load of the appear when the contentSize.height < scroll.frame.height, the contentInset isn't correct.

Repository: incubator-weex
Updated Branches:
  refs/heads/master 3222071d6 -> caf74c6c1


fix the bug of [WEEX-271][iOS] Extend the pulldown WXRefreshComponent to support immediate load of the appear
when the contentSize.height < scroll.frame.height, the contentInset isn't correct.


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

Branch: refs/heads/master
Commit: 0e2753df06c5c7df7f9cf70283f9345863462c27
Parents: c192766
Author: jianjun.mjj <ji...@alibaba-inc.com>
Authored: Mon Apr 2 19:22:17 2018 +0800
Committer: jianjun.mjj <ji...@alibaba-inc.com>
Committed: Mon Apr 2 19:22:17 2018 +0800

----------------------------------------------------------------------
 .../Sources/Component/WXRefreshComponent.m      | 22 +++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0e2753df/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
index 99876f4..585c9f3 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
@@ -151,13 +151,14 @@
     if ([scrollerProtocol respondsToSelector:@selector(refreshType)] &&
         [[scrollerProtocol refreshType] isEqualToString:@"refreshForAppear"]) {
         UIEdgeInsets inset = [scrollerProtocol contentInset];
-        inset.top = self.calculatedFrame.size.height;
         if (_displayState) {
+            inset.top = self.calculatedFrame.size.height;
             if ([_indicator.view isHidden]) {
                 [_indicator.view setHidden:NO];
             }
             [_indicator start];
         } else {
+            inset.top = 0;
             [_indicator stop];
         }
         [scrollerProtocol setContentInset:inset];
@@ -185,10 +186,21 @@
 
 - (void)setIndicatorHidden:(BOOL)hidden {
     [_indicator.view setHidden:hidden];
-    if (!hidden) {
-        [_indicator start];
-    } else {
-        [_indicator stop];
+    
+    id<WXScrollerProtocol> scrollerProtocol = self.ancestorScroller;
+    if (scrollerProtocol == nil || !_initFinished)
+        return;
+    if ([scrollerProtocol respondsToSelector:@selector(refreshType)] &&
+        [[scrollerProtocol refreshType] isEqualToString:@"refreshForAppear"]) {
+        UIEdgeInsets inset = [scrollerProtocol contentInset];
+        if (!hidden) {
+            inset.top = self.calculatedFrame.size.height;
+            [_indicator start];
+        } else {
+            inset.top = 0;
+            [_indicator stop];
+        }
+        [scrollerProtocol setContentInset:inset];
     }
 }
 


[2/2] incubator-weex git commit: Merge branch 'im_drop_down' of https://github.com/bbmjja8123/incubator-weex into merge-pull-request-master

Posted by ac...@apache.org.
Merge branch 'im_drop_down' of https://github.com/bbmjja8123/incubator-weex into merge-pull-request-master


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

Branch: refs/heads/master
Commit: caf74c6c11a941a0bd4588e6ef74ac25c4c61a25
Parents: 3222071 0e2753d
Author: acton393 <zh...@gmail.com>
Authored: Tue Apr 3 15:47:30 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Apr 3 15:47:30 2018 +0800

----------------------------------------------------------------------
 .../Sources/Component/WXRefreshComponent.m      | 22 +++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------