-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Closed
Copy link
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: Windows 10
Node: 6.11.4
Yarn: 1.1.0
npm: 4.6.1
Android Studio: Android Studio 2.3.2, Build #AI-162.3934792
Packages: (wanted => installed)
react-native: 0.47.2 => 0.47.2
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
Steps to Reproduce
- Set minimumTrackTintColor & maximumTrackTintColor props on the Slider component
- Run on Android
Expected Behavior
minimumTrackTintColor should set the progress color while the maximumTrackTintColor should set the background color.
Actual Behavior
On Android, minimumTrackTintColor sets the background color while the maximumTrackTintColor sets the progress color.
@ReactProp(name = "minimumTrackTintColor", customType = "Color")
public void setMinimumTrackTintColor(ReactSlider view, Integer color) {
LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
Drawable background = drawable.findDrawableByLayerId(android.R.id.background);
if (color == null) {
background.clearColorFilter();
} else {
background.setColorFilter(color, PorterDuff.Mode.SRC_IN);
}
}
@ReactProp(name = "maximumTrackTintColor", customType = "Color")
public void setMaximumTrackTintColor(ReactSlider view, Integer color) {
LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
Drawable progress = drawable.findDrawableByLayerId(android.R.id.progress);
if (color == null) {
progress.clearColorFilter();
} else {
progress.setColorFilter(color, PorterDuff.Mode.SRC_IN);
}
}
Reproducible Demo
import { Slider } from 'react-native';
...
<Slider
minimumTrackTintColor="white"
maximumTrackTintColor="gray"
/>
Metadata
Metadata
Assignees
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.