MultiSlider icon indicating copy to clipboard operation
MultiSlider copied to clipboard

Add support for change ripple thumb drawable

Open KamikX opened this issue 8 years ago • 2 comments

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.

KamikX avatar Aug 14 '17 22:08 KamikX

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
        }

bmx666 avatar Jan 16 '18 11:01 bmx666

Hi @bmx666 thanks for workaround 👍

KamikX avatar Jan 17 '18 10:01 KamikX