CKFlexboxComponent live editing

Summary:
CKFlexboxComponent's insets are now live editable

P.S. Now it takes some time to see the view changed and the new value of everything on flipper side

Reviewed By: kevin0571

Differential Revision: D16379743

fbshipit-source-id: 69bc9b7cb6b2103ff34b5c4489b240ac7562a85d
This commit is contained in:
Roman Gorbunov
2019-07-25 03:59:05 -07:00
committed by Facebook Github Bot
parent f42badeb88
commit b697d147d1
3 changed files with 132 additions and 18 deletions

View File

@@ -20,6 +20,16 @@ NSString *relativeDimension(CKRelativeDimension dimension) {
}
}
CKRelativeDimension relativeStructDimension(NSString *dimension) {
if ([dimension hasSuffix:@"%"]) {
return CKRelativeDimension::Percent([[dimension substringToIndex:([dimension length] - 1)] integerValue]);
}
if ([dimension hasSuffix:@"pt"]) {
return CKRelativeDimension::Points([[dimension substringToIndex:([dimension length] - 2)] integerValue]);
}
return CKRelativeDimension::Auto();
}
NSDictionary<NSString *, NSString *> *flexboxRect(CKFlexboxSpacing spacing) {
return @{
@"top": relativeDimension(spacing.top.dimension()),