Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for change ripple thumb drawable #65

Open
KamikX opened this issue Aug 14, 2017 · 2 comments
Open

Add support for change ripple thumb drawable #65

KamikX opened this issue Aug 14, 2017 · 2 comments

Comments

@KamikX
Copy link

KamikX commented Aug 14, 2017

Hi, it would be possible add support for change ripple thumb drawable ? I have issue with API 21 where android:attr/colorControlHighlight" native is "red", API > 21 works properly like native SeekBar. My idea is replace ripple drawable control_background_multi_material.xml with custom via xml attribute or programmatically. Thanks in advance for the answer.

@bmx666
Copy link
Contributor

bmx666 commented Jan 16, 2018

Hi @KamikX, workaround

        MultiSlider multiSlider = findViewById(R.id.range_slider);
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {

            ColorStateList colorStateListRipple = new ColorStateList(
                    new int[][] {{0}},
                    new int[] {Color.GREEN} // ripple color
            );

            RippleDrawable rippleDrawable = (RippleDrawable) multiSlider.getBackground();
            rippleDrawable.setColor(colorStateListRipple);
            multiSlider.setBackground(rippleDrawable); // applying the ripple color
        }

@KamikX
Copy link
Author

KamikX commented Jan 17, 2018

Hi @bmx666 thanks for workaround 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants