feat: add custom color for iOS13 segmented control (#27643)

Summary:
Addresses Issue from https://github.com/react-native-community/react-native-segmented-control/issues/16

SegmentedControlIOS changed how it looks in iOS13.

This PR allows allows more customization of SegmentedControl for iOS13.

## Changelog

[iOS] [Added] - add textColor and backgroundColor props for iOS >=13
Pull Request resolved: https://github.com/facebook/react-native/pull/27643

Test Plan:
| Before | After |
| --- | --- |
| <img src="https://user-images.githubusercontent.com/6936373/71608475-e68ff580-2bc4-11ea-9fe4-b85b99130356.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/71608757-dc6ef680-2bc6-11ea-85be-aa31f25ecf36.png" width="320" /> |

Differential Revision: D19296783

Pulled By: cpojer

fbshipit-source-id: 81a31b2d5ae3085a6fd1874e7d72e75be4c51318
This commit is contained in:
Jesse Katsumata
2020-01-06 22:17:32 -08:00
committed by Facebook Github Bot
parent ff9def41ff
commit e8f577e541
5 changed files with 33 additions and 0 deletions
@@ -35,6 +35,12 @@ public class SegmentedControlManagerDelegate<T extends View, U extends BaseViewM
case "tintColor":
mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "textColor":
mViewManager.setTextColor(view, value == null ? null : ((Double) value).intValue());
break;
case "backgroundColor":
mViewManager.setBackgroundColor(view, value == null ? null : ((Double) value).intValue());
break;
case "momentary":
mViewManager.setMomentary(view, value == null ? false : (boolean) value);
break;
@@ -18,5 +18,7 @@ public interface SegmentedControlManagerInterface<T extends View> {
void setSelectedIndex(T view, int value);
void setEnabled(T view, boolean value);
void setTintColor(T view, @Nullable Integer value);
void setTextColor(T view, @Nullable Integer value);
void setBackgroundColor(T view, @Nullable Integer value);
void setMomentary(T view, boolean value);
}