Add support for selectionColor on Android TextInput

Summary:
public
This adds support to set the highlight color on TextInput on Android.  See https://github.com/facebook/react-native/pull/5678 for the iOS implementation.

Note : We will merge these two properties with one name 'selectionColor' in a follow on diff, and may move it to a style.

Reviewed By: nicklockwood

Differential Revision: D2895253

fb-gh-sync-id: 6f2c08c812ff0028973185356a8af285f7dd7969
This commit is contained in:
Dave Miller
2016-02-03 05:48:31 -08:00
committed by facebook-github-bot-3
parent 2e8eb652e1
commit 0c91931adf
7 changed files with 39 additions and 21 deletions

View File

@@ -226,16 +226,15 @@ var TextInput = React.createClass({
* The text color of the placeholder string
*/
placeholderTextColor: PropTypes.string,
/**
* The highlight and cursor color of the text input
* @platform ios
*/
tintColor: PropTypes.string,
/**
* If true, the text input obscures the text entered so that sensitive text
* like passwords stay secure. The default value is false.
*/
secureTextEntry: PropTypes.bool,
/**
* The highlight (and cursor on ios) color of the text input
*/
selectionColor: PropTypes.string,
/**
* See DocumentSelectionState.js, some state that is responsible for
* maintaining selection information for a document
@@ -511,6 +510,7 @@ var TextInput = React.createClass({
password={this.props.password || this.props.secureTextEntry}
placeholder={this.props.placeholder}
placeholderTextColor={this.props.placeholderTextColor}
selectionColor={this.props.selectionColor}
text={this._getText()}
underlineColorAndroid={this.props.underlineColorAndroid}
children={children}