Search code examples
androidseekbar

Disabled seekBar without dimming


I need to prevent seekbar from user inputs in special cases. If I use setEnabled(false) it becomes gray instead of white.

Is there any method to disable seekbar without dimming or set another drawable for progress in disabled seekbar ?


Solution

  • I'm not sure why you'd want to change this, and I don't believe it's good practice to override the visual queue for a user that something is disabled. If it looks active, but doesn't interact, I'm going to be mad at your app.

    Regardless, to answer your question, you should look at StateListDrawable this question outlines it specifically for seek bars.