feat:iOS LinearLayout and adapt new layoutconfig

This commit is contained in:
pengfei.zhou
2019-10-23 19:37:06 +08:00
parent f78f3ed7d8
commit c2e3ef4f7e
26 changed files with 813 additions and 683 deletions

View File

@@ -24,6 +24,7 @@
#import "DoricContextManager.h"
#import "DoricRootNode.h"
#import "DoricConstant.h"
#import "DoricExtensions.h"
@implementation DoricContext
@@ -35,7 +36,7 @@ - (instancetype)initWithScript:(NSString *)script source:(NSString *)source {
_rootNode = [[DoricRootNode alloc] initWithContext:self];
_script = script;
_source = source;
_initialParams = [@{@"width": @(LAYOUT_MATCH_PARENT), @"height": @(LAYOUT_MATCH_PARENT)} mutableCopy];
_initialParams = [@{@"width": @(0), @"height": @(0)} mutableCopy];
[self callEntity:DORIC_ENTITY_CREATE, nil];
}
return self;
@@ -63,8 +64,10 @@ - (DoricAsyncResult *)callEntity:(NSString *)method withArgumentsArray:(NSArray
}
- (void)initContextWithWidth:(CGFloat)width height:(CGFloat)height {
[self.initialParams setValue:@(width) forKey:@"width"];
[self.initialParams setValue:@(height) forKey:@"height"];
[self.initialParams also:^(NSMutableDictionary *it) {
it[@"width"] = @(width);
it[@"height"] = @(height);
}];
[self callEntity:DORIC_ENTITY_INIT, self.initialParams, nil];
}