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/05/09 05:50:41 UTC

[1/2] incubator-weex git commit: + [ios] list component section header sticky event

Repository: incubator-weex
Updated Branches:
  refs/heads/0.13-dev 5d4d6ba1b -> 5d8e5f838


+ [ios] list component section header sticky event


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

Branch: refs/heads/0.13-dev
Commit: b9a1cd00629a08fadff1ff50aab9d76c2f91d54e
Parents: 5d4d6ba
Author: lybeen <il...@gmail.com>
Authored: Tue May 9 10:45:31 2017 +0800
Committer: lybeen <il...@gmail.com>
Committed: Tue May 9 12:36:12 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/WXListComponent.m | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b9a1cd00/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 e1a9d54..f47fe1a 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -100,6 +100,8 @@
 
 @interface WXListComponent () <UITableViewDataSource, UITableViewDelegate, WXCellRenderDelegate, WXHeaderRenderDelegate>
 
+@property (nonatomic, assign) NSUInteger currentTopVisibleSection;
+
 @end
 
 @implementation WXListComponent
@@ -576,6 +578,25 @@
     }
 }
 
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+    [super scrollViewDidScroll:scrollView];
+    NSIndexPath *topCellPath = [[_tableView indexPathsForVisibleRows] objectAtIndex:0];
+    if (self.currentTopVisibleSection != topCellPath.section) {
+        if (self.currentTopVisibleSection) {
+            WXSection *removeSection = [_sections objectAtIndex:self.currentTopVisibleSection];
+            if (removeSection.header && [removeSection.header.events containsObject:@"unSticky"]) {
+                [removeSection.header fireEvent:@"unSticky" params:nil];
+            }
+        }
+        self.currentTopVisibleSection = topCellPath.section;
+        WXSection *showSection = [_sections objectAtIndex:topCellPath.section];
+        if (showSection.header && [showSection.header.events containsObject:@"sticky"]) {
+            [showSection.header fireEvent:@"sticky" params:nil];
+        }
+    }
+}
+
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
     WXHeaderComponent *header = ((WXSection *)_completedSections[section]).header;


[2/2] incubator-weex git commit: * [ios] event name to lowercase

Posted by cx...@apache.org.
* [ios] event name to lowercase


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

Branch: refs/heads/0.13-dev
Commit: 5d8e5f838c79fa9914872ccbbbf989e2c9a1562c
Parents: b9a1cd0
Author: lybeen <il...@gmail.com>
Authored: Tue May 9 12:18:32 2017 +0800
Committer: lybeen <il...@gmail.com>
Committed: Tue May 9 12:37:36 2017 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5d8e5f83/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 f47fe1a..94f8435 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -585,8 +585,8 @@
     if (self.currentTopVisibleSection != topCellPath.section) {
         if (self.currentTopVisibleSection) {
             WXSection *removeSection = [_sections objectAtIndex:self.currentTopVisibleSection];
-            if (removeSection.header && [removeSection.header.events containsObject:@"unSticky"]) {
-                [removeSection.header fireEvent:@"unSticky" params:nil];
+            if (removeSection.header && [removeSection.header.events containsObject:@"unsticky"]) {
+                [removeSection.header fireEvent:@"unsticky" params:nil];
             }
         }
         self.currentTopVisibleSection = topCellPath.section;