mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-16 18:50:07 +08:00
color support for TextInput secureTextEntry={true}
Summary:Color property is ignored for TextInput with secureTextEntry={true} on Android.
This is coming from #6540 and being split into 2 PRs by suggestion of dmmiller.
As he mentioned does almost the same except it #6064 doesn't handle null case.
Working example:

Closes https://github.com/facebook/react-native/pull/6563
Differential Revision: D3077583
Pulled By: mkonicek
fb-gh-sync-id: f0761346b77060abf17f1d4573b375adebc5c607
shipit-source-id: f0761346b77060abf17f1d4573b375adebc5c607
This commit is contained in:
committed by
Facebook Github Bot 6
parent
77e1b3773a
commit
2a2ba4bd6b
@@ -410,11 +410,19 @@ exports.examples = [
|
||||
title: 'Passwords',
|
||||
render: function() {
|
||||
return (
|
||||
<TextInput
|
||||
defaultValue="iloveturtles"
|
||||
password={true}
|
||||
style={styles.singleLine}
|
||||
/>
|
||||
<View>
|
||||
<TextInput
|
||||
defaultValue="iloveturtles"
|
||||
secureTextEntry={true}
|
||||
style={styles.singleLine}
|
||||
/>
|
||||
<TextInput
|
||||
secureTextEntry={true}
|
||||
style={[styles.singleLine, {color: 'red'}]}
|
||||
placeholder="color is supported too"
|
||||
placeholderTextColor="red"
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -209,6 +209,15 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.COLOR, customType = "Color")
|
||||
public void setColor(ReactEditText view, @Nullable Integer color) {
|
||||
if (color == null) {
|
||||
view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));
|
||||
} else {
|
||||
view.setTextColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = "underlineColorAndroid", customType = "Color")
|
||||
public void setUnderlineColor(ReactEditText view, @Nullable Integer underlineColor) {
|
||||
if (underlineColor == null) {
|
||||
|
||||
Reference in New Issue
Block a user