Skip to content

Commit 3c96234

Browse files
authored
Merge pull request #3 from BenjaminPaap/feature/show-route-button
Added the possibility to hide the route button
2 parents 2df7c10 + f60d533 commit 3c96234

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class PlayerVolume extends React.Component {
4848
thumbTintColor="rgb(146,146,157)"
4949
minimumTrackTintColor="rgb(146,146,157)"
5050
maximumTrackTintColor="rgba(255,255,255, 0.1)"
51+
showsRouteButton={true}
5152
onValueChange={this.volumeChange.bind(this)} />
5253
</View>
5354
);
@@ -83,3 +84,6 @@ The color used for the thumb.
8384

8485
##### `thumbImage`
8586
Specify an image here to use as thumb. This will be drawn to the round
87+
88+
##### `showsRouteButton`
89+
Indicates whether or not to show the `routeButton` where the user can select the output target (airplay, headphones)

VolumeSlider.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class VolumeSlider extends Component {
4444
*/
4545
maximumTrackTintColor: PropTypes.string,
4646

47+
/**
48+
* Specifies whether or not to show the route button for airplay
49+
*/
50+
showsRouteButton: PropTypes.bool,
51+
4752
/**
4853
* Callback continuously called while the user is dragging the slider.
4954
*/
@@ -52,6 +57,7 @@ class VolumeSlider extends Component {
5257

5358
static defaultProps = {
5459
thumbSize: { width: 23, height: 23 },
60+
showsRouteButton: true
5561
};
5662

5763
render() {

ios/RNVolumeSlider/VolumeSliderManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ - (UIView *)view {
1313
RCT_EXPORT_VIEW_PROPERTY(thumbTintColor, UIColor);
1414
RCT_EXPORT_VIEW_PROPERTY(onValueChange, RCTBubblingEventBlock);
1515
RCT_EXPORT_VIEW_PROPERTY(thumbImage, UIImage);
16+
RCT_EXPORT_VIEW_PROPERTY(showsRouteButton, BOOL);
1617
RCT_CUSTOM_VIEW_PROPERTY(thumbSize, RCTthumbSize, VolumeSlider) {
1718
NSDictionary *thumbSize = (NSDictionary *) json;
1819

0 commit comments

Comments
 (0)