Skip to content

Commit

Permalink
Apply thumbTintColor to Sliders on iOS (#22177)
Browse files Browse the repository at this point in the history
Summary:
Applies the `thumbTintColor` prop to Sliders on iOS (which has been supported since iOS 5.0). Updates other documentation so that it is not labeled as Android-only, including the RNTester app
Pull Request resolved: facebook/react-native#22177

Differential Revision: D13695554

Pulled By: hramos

fbshipit-source-id: 250f6574b193a37b3cd237bcf42612c3e91bf813
  • Loading branch information
james-watkin committed Jan 16, 2019
1 parent 6dea1af commit aab8fa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions RCTSliderManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ - (void)sliderTouchEnd:(RCTSlider *)sender
RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, UIColor);
RCT_EXPORT_VIEW_PROPERTY(onValueChange, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onSlidingComplete, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(thumbTintColor, UIColor);
RCT_EXPORT_VIEW_PROPERTY(thumbImage, UIImage);
RCT_CUSTOM_VIEW_PROPERTY(disabled, BOOL, RCTSlider)
{
Expand Down
14 changes: 5 additions & 9 deletions Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,9 @@ type IOSProps = $ReadOnly<{|
thumbImage?: ?ImageSource,
|}>;

type AndroidProps = $ReadOnly<{|
/**
* Color of the foreground switch grip.
* @platform android
*/
thumbTintColor?: ?ColorValue,
|}>;

type Props = $ReadOnly<{|
...ViewProps,
...IOSProps,
...AndroidProps,

/**
* Used to style and layout the `Slider`. See `StyleSheet.js` and
Expand Down Expand Up @@ -117,6 +108,11 @@ type Props = $ReadOnly<{|
* Overrides the default blue gradient image on iOS.
*/
maximumTrackTintColor?: ?ColorValue,
/**
* The color used to tint the default thumb images on iOS, or the
* color of the foreground switch grip on Android.
*/
thumbTintColor?: ?ColorValue,

/**
* If true the user won't be able to move the slider.
Expand Down

0 comments on commit aab8fa4

Please sign in to comment.