Giter Club home page Giter Club logo

Comments (11)

Evyraad avatar Evyraad commented on May 28, 2024 9

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.

BartoszKlonowski avatar BartoszKlonowski commented on May 28, 2024 2

@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.

ThomasStubbe avatar ThomasStubbe commented on May 28, 2024 1

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.

incandescentxxc avatar incandescentxxc commented on May 28, 2024

(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.

BartoszKlonowski avatar BartoszKlonowski commented on May 28, 2024

@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.

BartoszKlonowski avatar BartoszKlonowski commented on May 28, 2024

Closing due to lack of author's feedback.
Feel free to reopen if this issue still occurs.

from react-native-slider.

BartoszKlonowski avatar BartoszKlonowski commented on May 28, 2024

Thank you for checking and letting me know, @ThomasStubbe!
I will reopen this obviously 👍

from react-native-slider.

artsnr1 avatar artsnr1 commented on May 28, 2024

The issue is still there

from react-native-slider.

kumailrazapeekaboo avatar kumailrazapeekaboo commented on May 28, 2024

is this issue not resolved yet?

from react-native-slider.

kumailrazapeekaboo avatar kumailrazapeekaboo commented on May 28, 2024

@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.

BartoszKlonowski avatar BartoszKlonowski commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.