add panel.onRederFinished to be invoked after shader.render make sure coordinatorPlugin affected
This commit is contained in:
@@ -15,8 +15,8 @@ typedef NS_ENUM(NSInteger, DoricLogType) {
|
||||
/**
|
||||
* Called when native or js exception occurred in doric
|
||||
*
|
||||
* @param source Which source file
|
||||
* @param e exception which is thrown within doric sdk
|
||||
* @param exception exception which is thrown within doric sdk
|
||||
* @param context Which Context
|
||||
*/
|
||||
- (void)onException:(NSException *)exception inContext:(DoricContext *)context;
|
||||
|
||||
|
@@ -23,13 +23,6 @@
|
||||
#import "DoricUtil.h"
|
||||
|
||||
@implementation DoricCoordinatorPlugin
|
||||
- (void)ready:(id)param withPromise:(DoricPromise *)promise {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[promise resolve:nil];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)verticalScrolling:(NSDictionary *)params withPromise:(DoricPromise *)promise {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@@ -75,7 +68,9 @@ - (void)verticalScrolling:(NSDictionary *)params withPromise:(DoricPromise *)pro
|
||||
NSNumber *changingStart = changing[@"start"];
|
||||
NSNumber *changingEnd = changing[@"end"];
|
||||
if ([scrollNode conformsToProtocol:@protocol(DoricScrollableProtocol)]) {
|
||||
((id <DoricScrollableProtocol>) scrollNode).didScrollListener = ^(UIScrollView *scrollView) {
|
||||
__weak typeof(self) __self = self;
|
||||
[(id <DoricScrollableProtocol>) scrollNode addDidScrollBlock:^(UIScrollView *scrollView) {
|
||||
__strong typeof(__self) self = __self;
|
||||
CGFloat scrollY = scrollView.contentOffset.y;
|
||||
if (scrollY <= startAnchor) {
|
||||
[self setValue:targetNode isNavBar:isNavBar name:name value:changingStart];
|
||||
@@ -102,7 +97,7 @@ - (void)verticalScrolling:(NSDictionary *)params withPromise:(DoricPromise *)pro
|
||||
}
|
||||
[self setValue:targetNode isNavBar:isNavBar name:name value:value];
|
||||
}
|
||||
};
|
||||
}];
|
||||
} else {
|
||||
[promise reject:@"Scroller type error"];
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
@implementation DoricShaderPlugin
|
||||
|
||||
- (void)render:(NSDictionary *)argument {
|
||||
- (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
||||
if (!argument) {
|
||||
return;
|
||||
}
|
||||
@@ -45,10 +45,11 @@ - (void)render:(NSDictionary *)argument {
|
||||
DoricViewNode *viewNode = [self.doricContext targetViewNode:viewId];
|
||||
[viewNode blend:argument[@"props"]];
|
||||
}
|
||||
[promise resolve:nil];
|
||||
});
|
||||
}
|
||||
|
||||
- (id)command:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
||||
- (void)command:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
||||
NSArray *viewIds = argument[@"viewIds"];
|
||||
id args = argument[@"args"];
|
||||
NSString *name = argument[@"name"];
|
||||
@@ -64,9 +65,8 @@ - (id)command:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
||||
}
|
||||
if (!viewNode) {
|
||||
[promise reject:@"Cannot find opposite view"];
|
||||
return nil;
|
||||
} else {
|
||||
return [self findClass:[viewNode class] target:viewNode method:name promise:promise argument:args];
|
||||
[self findClass:[viewNode class] target:viewNode method:name promise:promise argument:args];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,8 @@ - (id)createParamWithMethodName:(NSString *)method promise:(DoricPromise *)promi
|
||||
return argument;
|
||||
}
|
||||
|
||||
- (id)findClass:(Class)clz target:(id)target method:(NSString *)name promise:(DoricPromise *)promise argument:(id)argument {
|
||||
- (void)findClass:(Class)clz target:(id)target method:(NSString *)name promise:(DoricPromise *)promise argument:(id)argument {
|
||||
unsigned int count;
|
||||
id ret = nil;
|
||||
Method *methods = class_copyMethodList(clz, &count);
|
||||
BOOL isFound = NO;
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -122,7 +121,6 @@ - (id)findClass:(Class)clz target:(id)target method:(NSString *)name promise:(Do
|
||||
[promise resolve:returnValue];
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -135,10 +133,9 @@ - (id)findClass:(Class)clz target:(id)target method:(NSString *)name promise:(Do
|
||||
if (!isFound) {
|
||||
Class superclass = class_getSuperclass(clz);
|
||||
if (superclass && superclass != [NSObject class]) {
|
||||
return [self findClass:superclass target:target method:name promise:promise argument:argument];
|
||||
[self findClass:superclass target:target method:name promise:promise argument:argument];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user