Fix: set underlineColorAndroid properly

Summary:
This PR fixes #6332

The issue is that Android Framework will return the same drawable instance for all requests if they request for the same resource. So the changes on the drawable instance will affect all users(`TextInput` in this case). The solution is very easy, call `mutate()` before change it will get a new drawable instance which make sure the change doesn't affect other users.
Closes https://github.com/facebook/react-native/pull/12493

Differential Revision: D4620034

Pulled By: astreet

fbshipit-source-id: a7b10fbc7447e01132b7ca0e1f78413796493e07
This commit is contained in:
Swordsman-Inaction 2017-02-27 04:08:07 -08:00 committed by Facebook Github Bot
parent 800dc77172
commit 8b01508410
1 changed files with 1 additions and 1 deletions

View File

@ -370,7 +370,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
if (underlineColor == null) {
view.getBackground().clearColorFilter();
} else {
view.getBackground().setColorFilter(underlineColor, PorterDuff.Mode.SRC_IN);
view.getBackground().mutate().setColorFilter(underlineColor, PorterDuff.Mode.SRC_IN);
}
}