Add selectionColor prop for Text on Android

Summary:
**Motivation**

Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`.

**Test plan (required)**

Run UIExplorer example with the changes and verify everything works fine.

![image](https://cloud.githubusercontent.com/assets/1174278/22023258/70197d84-dceb-11e6-8662-2879d78d14d4.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11947

Differential Revision: D4430265

fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
This commit is contained in:
Satyajit Sahoo
2017-01-18 12:53:58 -08:00
committed by Facebook Github Bot
parent 81c33b542d
commit 72be2d35cc
3 changed files with 51 additions and 22 deletions

View File

@@ -386,10 +386,15 @@ class TextExample extends React.Component {
</Text>
</UIExplorerBlock>
<UIExplorerBlock title="selectable attribute">
<Text selectable={true}>
<Text selectable>
This text is selectable if you click-and-hold, and will offer the native Android selection menus.
</Text>
</UIExplorerBlock>
<UIExplorerBlock title="selectionColor attribute">
<Text selectable selectionColor="orange">
This text will have a orange highlight on selection.
</Text>
</UIExplorerBlock>
<UIExplorerBlock title="Inline images">
<Text>
This text contains an inline image <Image source={require('./flux.png')}/>. Neat, huh?