How to hide/show thumb drawable in a SeekBar
The best way to do this is to set the drawable for the thumb from XML (as I was doing all along) and then when you want to hide/show the Thumb drawable, just manipulate it's alpha value:
// Hide the thumb drawable if the SeekBar is disabled
if (enabled) {
seekBar.getThumb().mutate().setAlpha(255);
} else {
seekBar.getThumb().mutate().setAlpha(0);
}
Edit:
If thumb appearing white after setting alpha to zero, try adding
<SeekBar
....
android:splitTrack="false"
/>
Hide your thumb in a SeekBar via xml
android:thumbTint="@color/transparent"
for Example
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:thumb="@color/gray"
android:thumbTint="@android:color/transparent" />