I want to hide bar and only want to show thumb. I did it with max-height=0dip but it did not completely work. I also want to set text on thumb and create thumb with multiple
SeekBar seekbar = new SeekBar(context, attrs);
// ------------- custom thumb
//----- using resources
seekbar.setThumb(new BitmapDrawable(BitmapFactory.decodeResource(
context.getResources(), R.drawable.seekbar_progress_thumb)));
//----- or using shape drawable
ShapeDrawable thumb = new ShapeDrawable(new RectShape());
thumb.getPaint().setColor(Color.rgb(0, 0, 0));
thumb.setIntrinsicHeight(-80);
thumb.setIntrinsicWidth(30);
seekbar.setThumb(thumb);
Regarding removing the background, I managed to do this in the following way. Here, the blank drawable is a transparent png of 1x1 pixel
<SeekBar
android:id="@+id/bar"
android:layout_width="fill_parent"
android:layout_height="30dip"
android:progressDrawable="@drawable/blank"
/>
You can also change the drawable by using:
android:thumb="@drawable/icon"
To add text, I guess you'll have to create a custom component
In order to hide the bar, you can set opacity value using hex colors. You just need to add the right prefix. I hid the seekBar using this code:
android:progressBackgroundTint="#00555555"
android:progressTint="#00555555"
Where the first two ciphers (i.e. "00") set opaqueness (alpha percentage) and the other six (i.e. "555555") set the color.
Check this post for more information and a list of hex opacity values: Understanding colors on Android (six characters)