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 2018/07/12 04:33:04 UTC

[1/2] incubator-weex git commit: [WEEX-501][iOS] Try to fix insert table view cell exception abort on iOS

Repository: incubator-weex
Updated Branches:
  refs/heads/master 44a3c412a -> 5ca1f002a


[WEEX-501][iOS] Try to fix insert table view cell exception abort on iOS


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

Branch: refs/heads/master
Commit: bedc6aa4759086ddb7fe14181be6384eed394192
Parents: 44a3c41
Author: Xiaomin <ca...@yahoo.com>
Authored: Thu Jul 12 12:06:42 2018 +0800
Committer: Xiaomin <ca...@yahoo.com>
Committed: Thu Jul 12 12:06:42 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm |  8 ++++++--
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m        |  3 +++
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.h          |  4 ++++
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m          | 11 +++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bedc6aa4/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
index 854aa3a..5f14aa0 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
@@ -31,6 +31,7 @@
 #import "WXRefreshComponent.h"
 #import "WXLoadingComponent.h"
 #import "WXScrollerComponent+Layout.h"
+#import "WXThreadSafeMutableArray.h"
 
 @interface WXTableView : UITableView
 
@@ -94,8 +95,11 @@
 - (instancetype)init
 {
     if (self = [super init]) {
-        _rows = [NSMutableArray array];
-    }
+		if ([WXUtility listSectionRowThreadSafe]) {
+			_rows = [WXThreadSafeMutableArray array];
+		} else {
+			_rows = [NSMutableArray array];
+		}    }
     
     return self;
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bedc6aa4/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index a2ab434..db08941 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -326,6 +326,9 @@ typedef enum : NSUInteger {
         BOOL unregisterFontWhenCollision = [[configCenter configForKey:@"iOS_weex_ext_config.unregisterFontWhenCollision" defaultValue:@NO isDefault:NULL] boolValue];
         [WXUtility setUnregisterFontWhenCollision:unregisterFontWhenCollision];
 
+		BOOL listSectionRowThreadSafe = [[configCenter configForKey:@"iOS_weex_ext_config.listSectionRowThreadSafe" defaultValue:@(YES) isDefault:NULL] boolValue];
+		[WXUtility setListSectionRowThreadSafe:listSectionRowThreadSafe];
+		
         //Reading config from orange for Release instance in Main Thread or not
         _bReleaseInstanceInMainThread = [[configCenter configForKey:@"iOS_weex_ext_config.releaseInstanceInMainThread" defaultValue:@(YES) isDefault:nil] boolValue];
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bedc6aa4/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
index 53d1308..9babd18 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
@@ -489,4 +489,8 @@ BOOL WXFloatGreaterThanWithPrecision(CGFloat a,CGFloat b,double precision);
 
 + (void)setUnregisterFontWhenCollision:(BOOL)value;
 
++ (void)setListSectionRowThreadSafe:(BOOL)value;
+
++ (BOOL)listSectionRowThreadSafe;
+
 @end

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bedc6aa4/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index f2e325e..62c0f3e 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -43,6 +43,7 @@
 
 static BOOL threadSafeCollectionUsingLock = YES;
 static BOOL unregisterFontWhenCollision = NO;
+static BOOL listSectionRowThreadSafe = YES;
 
 void WXPerformBlockOnMainThread(void (^ _Nonnull block)(void))
 {
@@ -153,6 +154,16 @@ CGFloat WXFloorPixelValue(CGFloat value)
     unregisterFontWhenCollision = value;
 }
 
++ (void)setListSectionRowThreadSafe:(BOOL)value
+{
+	listSectionRowThreadSafe = value;
+}
+
++ (BOOL)listSectionRowThreadSafe
+{
+	return listSectionRowThreadSafe;
+}
+
 + (void)performBlock:(void (^)(void))block onThread:(NSThread *)thread
 {
     if (!thread || !block) return;


[2/2] incubator-weex git commit: [WEEX-500][iOS] Fix Sticky in List will not be removed in some cases

Posted by cx...@apache.org.
[WEEX-500][iOS] Fix Sticky in List will not be removed in some cases


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

Branch: refs/heads/master
Commit: 5ca1f002a0df89f5a13b363ab28323b76f80438e
Parents: bedc6aa
Author: Xiaomin <ca...@yahoo.com>
Authored: Wed Jul 11 20:41:37 2018 +0800
Committer: Adam Feng <cx...@gmail.com>
Committed: Thu Jul 12 12:32:00 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm | 4 +++-
 ios/sdk/WeexSDK/Sources/Model/WXComponent.mm             | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5ca1f002/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
index 9b8a1a2..056ca4e 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
@@ -354,7 +354,9 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
 {
     if([self.stickyArray containsObject:sticky]) {
         [self.stickyArray removeObject:sticky];
-        [self adjustSticky];
+		WXPerformBlockOnMainThread(^{
+			[self adjustSticky];
+		});
     }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5ca1f002/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
index d877868..467a6b7 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
@@ -602,6 +602,9 @@ static BOOL bNeedRemoveEvents = YES;
         [self.weexInstance.componentManager removeFixedComponent:self];
         self->_isNeedJoinLayoutSystem = YES;
     }
+	if (_positionType == WXPositionTypeSticky) {
+		[self.ancestorScroller removeStickyComponent:self];
+	}
 }
 
 - (void)_moveToSupercomponent:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index