Android SeekBar setup

I want to hide the panel and want to show a thumb. I did this with max-height = 0dip, but it did not fully work. I also want to set the text on the thumb and create a thumb with multiple images. For example, the thumb, which I find as an image, has text, and this button has tail anti-aliasing, which increases with increasing line.

+5
source share
3 answers

Regarding background removal, I managed to do it as follows. Here the empty line is transparent 1x1 pixel png

    <SeekBar
        android:id="@+id/bar"
        android:layout_width="fill_parent"
        android:layout_height="30dip"
        android:progressDrawable="@drawable/blank"
     />

You can also change the selection using:

android:thumb="@drawable/icon"

, ,

+15
  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);
+1

, , . . seekBar, :

android:progressBackgroundTint="#00555555"
android:progressTint="#00555555"

( "00" ) (-), (.. "555555" ) .

: Android ( )

-1

All Articles