feat:fix Refreshable pulldown and so on
This commit is contained in:
parent
a41036c91d
commit
9be891e284
@ -24,4 +24,5 @@
|
||||
#import "DoricJSLoaderManager.h"
|
||||
#import "DoricNavigatorDelegate.h"
|
||||
#import "DoricNavBarDelegate.h"
|
||||
#import "DoricViewController.h"
|
||||
#import "DoricViewController.h"
|
||||
#import "DoricPromise.h"
|
@ -154,4 +154,21 @@ - (void)setProgressRotation:(CGFloat)rotation {
|
||||
[self.headerNode callJSResponse:@"setProgressRotation", @(rotation), nil];
|
||||
}
|
||||
|
||||
- (void)setRefreshing:(NSNumber *)refreshable withPromise:(DoricPromise *)promise {
|
||||
self.view.refreshing = [refreshable boolValue];
|
||||
[promise resolve:nil];
|
||||
}
|
||||
|
||||
- (void)setRefreshable:(NSNumber *)refreshing withPromise:(DoricPromise *)promise {
|
||||
self.view.refreshable = [refreshing boolValue];
|
||||
[promise resolve:nil];
|
||||
}
|
||||
|
||||
- (NSNumber *)isRefreshing {
|
||||
return @(self.view.refreshing);
|
||||
}
|
||||
|
||||
- (NSNumber *)isRefreshable {
|
||||
return @(self.view.refreshable);
|
||||
}
|
||||
@end
|
||||
|
@ -79,6 +79,9 @@ - (void)setRefreshing:(BOOL)refreshing {
|
||||
return;
|
||||
}
|
||||
if (refreshing) {
|
||||
if (self.onRefreshBlock) {
|
||||
self.onRefreshBlock();
|
||||
}
|
||||
[UIView animateWithDuration:0.3f
|
||||
animations:^{
|
||||
self.contentInset = UIEdgeInsetsMake(self.headerView.height, 0, 0, 0);
|
||||
|
@ -543,7 +543,7 @@ - (CGSize)targetLayoutSize {
|
||||
width = self.superview.width;
|
||||
}
|
||||
if (self.layoutConfig.heightSpec == DoricLayoutAtMost
|
||||
|| self.layoutConfig.widthSpec == DoricLayoutWrapContent) {
|
||||
|| self.layoutConfig.heightSpec == DoricLayoutWrapContent) {
|
||||
height = self.superview.height;
|
||||
}
|
||||
return CGSizeMake(width, height);
|
||||
|
@ -36,10 +36,13 @@ @implementation DoricTableView
|
||||
- (CGSize)sizeThatFits:(CGSize)size {
|
||||
if (self.subviews.count > 0) {
|
||||
CGFloat width = size.width;
|
||||
CGFloat height = 0;
|
||||
|
||||
for (UIView *child in self.subviews) {
|
||||
width = MAX(child.width, width);
|
||||
height += child.height;
|
||||
}
|
||||
return CGSizeMake(width, size.width);
|
||||
return CGSizeMake(width, height);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@ -74,9 +77,11 @@ - (UITableView *)build {
|
||||
- (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"itemCount" isEqualToString:name]) {
|
||||
self.itemCount = [prop unsignedIntegerValue];
|
||||
[self.view reloadData];
|
||||
} else if ([@"renderItem" isEqualToString:name]) {
|
||||
[self.itemViewIds removeAllObjects];
|
||||
[self clearSubModel];
|
||||
[self.view reloadData];
|
||||
} else if ([@"batchCount" isEqualToString:name]) {
|
||||
self.batchCount = [prop unsignedIntegerValue];
|
||||
} else {
|
||||
|
@ -80,9 +80,11 @@ - (UICollectionView *)build {
|
||||
- (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"itemCount" isEqualToString:name]) {
|
||||
self.itemCount = [prop unsignedIntegerValue];
|
||||
[self.view reloadData];
|
||||
} else if ([@"renderPage" isEqualToString:name]) {
|
||||
[self.itemViewIds removeAllObjects];
|
||||
[self clearSubModel];
|
||||
[self.view reloadData];
|
||||
} else if ([@"batchCount" isEqualToString:name]) {
|
||||
self.batchCount = [prop unsignedIntegerValue];
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user