mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
[ReactNative] Updated RKText to new UIManager system
This commit is contained in:
parent
1decb7e1cb
commit
18d1805695
@ -23,6 +23,8 @@
|
|||||||
return [[RCTShadowText alloc] init];
|
return [[RCTShadowText alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - View properties
|
||||||
|
|
||||||
RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor)
|
RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor)
|
||||||
RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText)
|
RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText)
|
||||||
{
|
{
|
||||||
@ -34,6 +36,8 @@ RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText)
|
|||||||
view.lineBreakMode = truncationMode;
|
view.lineBreakMode = truncationMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - Shadow properties
|
||||||
|
|
||||||
RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText)
|
RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText)
|
||||||
{
|
{
|
||||||
view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor;
|
view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
+ (NSTextAlignment)NSTextAlignment:(id)json;
|
+ (NSTextAlignment)NSTextAlignment:(id)json;
|
||||||
+ (NSWritingDirection)NSWritingDirection:(id)json;
|
+ (NSWritingDirection)NSWritingDirection:(id)json;
|
||||||
|
+ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json;
|
||||||
+ (UIKeyboardType)UIKeyboardType:(id)json;
|
+ (UIKeyboardType)UIKeyboardType:(id)json;
|
||||||
|
|
||||||
+ (CGFloat)CGFloat:(id)json;
|
+ (CGFloat)CGFloat:(id)json;
|
||||||
|
@ -17,20 +17,24 @@
|
|||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(caretHidden)
|
RCT_EXPORT_VIEW_PROPERTY(caretHidden)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(autoCorrect)
|
RCT_EXPORT_VIEW_PROPERTY(autoCorrect)
|
||||||
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType)
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(enabled)
|
RCT_EXPORT_VIEW_PROPERTY(enabled)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(placeholder)
|
RCT_EXPORT_VIEW_PROPERTY(placeholder)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(text)
|
RCT_EXPORT_VIEW_PROPERTY(text)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(clearButtonMode)
|
RCT_EXPORT_VIEW_PROPERTY(clearButtonMode)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
|
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
|
||||||
RCT_REMAP_VIEW_PROPERTY(color, textColor)
|
RCT_REMAP_VIEW_PROPERTY(color, textColor)
|
||||||
|
RCT_CUSTOM_VIEW_PROPERTY(autoCapitalize, RCTTextField)
|
||||||
|
{
|
||||||
|
view.autocapitalizationType = json ? [RCTConvert UITextAutocapitalizationType:json]
|
||||||
|
: defaultView.autocapitalizationType;
|
||||||
|
}
|
||||||
RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField)
|
RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField)
|
||||||
{
|
{
|
||||||
view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
|
view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
|
||||||
}
|
}
|
||||||
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField)
|
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField)
|
||||||
{
|
{
|
||||||
view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO
|
view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO: default value
|
||||||
}
|
}
|
||||||
RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField)
|
RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField)
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// View properties
|
#pragma mark - View properties
|
||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(accessibilityLabel)
|
RCT_EXPORT_VIEW_PROPERTY(accessibilityLabel)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(hidden)
|
RCT_EXPORT_VIEW_PROPERTY(hidden)
|
||||||
@ -110,7 +110,7 @@ RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShadowView properties
|
#pragma mark - ShadowView properties
|
||||||
|
|
||||||
RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView)
|
RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user