Comments (11)
I think the problem is that the “progress bar" background has a layer with translucence, so we are getting wrong colors.
Therefore I suggest to rewrite the Slider progress bar.
- you need to change your
./android/app/src/main/res/values/styles.xml
file:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
. . .
<item name="android:seekBarStyle">@style/SeekbarStyle</item>
</style>
<style name="SeekbarStyle" parent="Widget.AppCompat.SeekBar">
<item name="android:progressDrawable">@drawable/seekbar_style</item>
</style>
</resources>
- and to add a
seekbar_style.xml
file to./android/app/src/main/res/drawable
directory
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:gravity="center_vertical|fill_horizontal"
>
<shape android:shape="line">
<stroke android:width="2dp" android:color="#ffffff"/>
<corners android:radius="2dp"/>
</shape>
</item>
<item
android:id="@android:id/progress"
android:gravity="center_vertical|fill_horizontal">
<clip>
<scale android:scaleWidth="100%">
<selector>
<item android:state_enabled="false"
android:drawable="@android:color/transparent" />
<item>
<shape android:shape="line">
<stroke android:width="2dp" android:color="#2ea5de" />
<corners android:radius="2dp"/>
</shape>
</item>
</selector>
</scale>
</clip>
</item>
</layer-list>
from react-native-slider.
@artsnr1 Yes, thanks for confirmation!
The issue is due to how Android renders the seekbar by default on the native side, difficult to change that behavior, but I'm working on it.
Thanks for the patience!
from react-native-slider.
This is still the case in version 4.1.12
To get the colors equal you need to set minimum to "#BBBBBB" and maximum to "#000000" and then you get "#BBBBBB" for both:
<Slider minimumValue={0}
maximumValue={10}
step={1}
minimumTrackTintColor="#BBBBBB"
maximumTrackTintColor="#000000" />
from react-native-slider.
(ANDROID) Same problem happens not only "when maximumTintColor matches minimumTintColor". Seems the maximumTintColor is always lighter than the original color. e.g. If you use "#000000", it's obvious that the default grey color is not overridden at all.
from react-native-slider.
@a-koka This issue is reported on the outdated version of package.
Can you please check if the same issue occurs on the latest release v4.1.1?
from react-native-slider.
Closing due to lack of author's feedback.
Feel free to reopen if this issue still occurs.
from react-native-slider.
Thank you for checking and letting me know, @ThomasStubbe!
I will reopen this obviously 👍
from react-native-slider.
The issue is still there
from react-native-slider.
is this issue not resolved yet?
from react-native-slider.
@artsnr1 Yes, thanks for confirmation! The issue is due to how Android renders the seekbar by default on the native side, difficult to change that behavior, but I'm working on it. Thanks for the patience!
not resolved yet ?
from react-native-slider.
Hello @kumailrazapeekaboo! Yes, as you can see this issue is still in the Backlog.
I will move it to In Progress as soon as I'll start to work on this, or when community folks open a PR, which would be very welcomed!
from react-native-slider.
Related Issues (20)
- Vertical prop is not working HOT 1
- How can I hide the slider from the screen? HOT 5
- Bar height - Is it possible increase the height of the bar? HOT 2
- not working on iOS and Android, only web? HOT 6
- Invariant Violation: requireNativeComponent: "RNCSlider" was not found in the UIManager. HOT 4
- Unable to build on latest version of Xcode | ContextContainer.h not found HOT 4
- property "disabled" doesn't work on Android (4.4.2) HOT 2
- Slider with steps indicator, custom thumb component and more to come... HOT 7
- seekTo() make position back to 0
- Documentation should be kept in GH Pages instead of README.
- When maximumValue changed value returns to last "clicked" position on Android
- How to use Tap in Android? HOT 2
- useState callback do not execute inside onSlidingComplete using tap. HOT 1
- Custom thumb image in Android becomes huge in contrary of iOS which is the the requested size HOT 2
- Clarification on `onValueChange` Behavior Across Platforms HOT 2
- lowerLimit for web HOT 1
- Wrong in Task :react-native-community_slider:compileReleaseJavaWithJavac FAILED
- Issue with Thumb Positioning in Web Implementation
- onValueChange triggers an extra time after onSlidingCompleted on Android HOT 2
- Android: StackOverflow when `lowerLimit` is greater than `upperLimit` (and, on some devices, when the slider first loads) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-slider.