iOS: fix listItem cannot be animated
This commit is contained in:
parent
c3093d9ff2
commit
0477e5790b
@ -293,26 +293,26 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
|
||||
}
|
||||
|
||||
- (void)blendSubNode:(NSDictionary *)subModel {
|
||||
NSString *viewId = subModel[@"id"];
|
||||
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
|
||||
BOOL skipReload = NO;
|
||||
if (viewNode) {
|
||||
CGSize originSize = viewNode.view.frame.size;
|
||||
[viewNode blend:subModel[@"props"]];
|
||||
[viewNode.view.doricLayout apply];
|
||||
[viewNode requestLayout];
|
||||
if (CGSizeEqualToSize(originSize, viewNode.view.frame.size)) {
|
||||
skipReload = YES;
|
||||
}
|
||||
} else {
|
||||
NSMutableDictionary *model = [[self subModelOf:viewId] mutableCopy];
|
||||
[self recursiveMixin:subModel to:model];
|
||||
[self setSubModel:model in:viewId];
|
||||
}
|
||||
if (skipReload) {
|
||||
return;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSString *viewId = subModel[@"id"];
|
||||
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
|
||||
BOOL skipReload = NO;
|
||||
if (viewNode) {
|
||||
CGSize originSize = viewNode.view.frame.size;
|
||||
[viewNode blend:subModel[@"props"]];
|
||||
[viewNode.view.doricLayout apply];
|
||||
[viewNode requestLayout];
|
||||
if (CGSizeEqualToSize(originSize, viewNode.view.frame.size)) {
|
||||
skipReload = YES;
|
||||
}
|
||||
} else {
|
||||
NSMutableDictionary *model = [[self subModelOf:viewId] mutableCopy];
|
||||
[self recursiveMixin:subModel to:model];
|
||||
[self setSubModel:model in:viewId];
|
||||
}
|
||||
if (skipReload) {
|
||||
return;
|
||||
}
|
||||
[self.itemViewIds enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSString *_Nonnull obj, BOOL *_Nonnull stop) {
|
||||
if ([viewId isEqualToString:obj]) {
|
||||
*stop = YES;
|
||||
|
@ -280,26 +280,26 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
|
||||
- (void)blendSubNode:(NSDictionary *)subModel {
|
||||
///Here async blend sub node because the item count need to be applied first.
|
||||
NSUInteger currentCount = self.itemCount + (self.loadMore ? 1 : 0);
|
||||
NSString *viewId = subModel[@"id"];
|
||||
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
|
||||
BOOL skipReload = NO;
|
||||
if (viewNode) {
|
||||
CGSize originSize = viewNode.view.frame.size;
|
||||
[viewNode blend:subModel[@"props"]];
|
||||
[viewNode.view.doricLayout apply:CGSizeMake(self.view.width, self.view.height)];
|
||||
[viewNode requestLayout];
|
||||
if (CGSizeEqualToSize(originSize, viewNode.view.frame.size)) {
|
||||
skipReload = YES;
|
||||
}
|
||||
} else {
|
||||
NSMutableDictionary *model = [[self subModelOf:viewId] mutableCopy];
|
||||
[self recursiveMixin:subModel to:model];
|
||||
[self setSubModel:model in:viewId];
|
||||
}
|
||||
if (skipReload) {
|
||||
return;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSString *viewId = subModel[@"id"];
|
||||
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
|
||||
BOOL skipReload = NO;
|
||||
if (viewNode) {
|
||||
CGSize originSize = viewNode.view.frame.size;
|
||||
[viewNode blend:subModel[@"props"]];
|
||||
[viewNode.view.doricLayout apply:CGSizeMake(self.view.width, self.view.height)];
|
||||
[viewNode requestLayout];
|
||||
if (CGSizeEqualToSize(originSize, viewNode.view.frame.size)) {
|
||||
skipReload = YES;
|
||||
}
|
||||
} else {
|
||||
NSMutableDictionary *model = [[self subModelOf:viewId] mutableCopy];
|
||||
[self recursiveMixin:subModel to:model];
|
||||
[self setSubModel:model in:viewId];
|
||||
}
|
||||
if (skipReload) {
|
||||
return;
|
||||
}
|
||||
[self.itemViewIds enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSString *_Nonnull obj, BOOL *_Nonnull stop) {
|
||||
if ([viewId isEqualToString:obj]) {
|
||||
*stop = YES;
|
||||
|
Reference in New Issue
Block a user