B
B
Bogdan2019-04-23 15:30:15
Java
Bogdan, 2019-04-23 15:30:15

SeekBar thumb stroke?

Hello. but don't tell me? Did you programmatically customize the SeekBar, increased the thumb, but now there is a kind of stroke around the circle? Do not tell me how to fix it?
5cbf051bbc3e2371460772.jpeg

ShapeDrawable thumb = new android.graphics.drawable.ShapeDrawable(
                new android.graphics.drawable.shapes.OvalShape()
        );


        thumb.setColorFilter(android.graphics.Color.RED, PorterDuff.Mode.SRC );
        thumb.setIntrinsicHeight( 80 );
        thumb.setIntrinsicWidth( 80 );


        SeekBar seekbar = findViewById(R.id.seekbar);
        seekbar.setThumb(thumb);
        seekbar.setThumbOffset(0);

        seekbar.getProgressDrawable().setColorFilter(new android.graphics.PorterDuffColorFilter(Color.RED, android.graphics.PorterDuff.Mode.SRC_IN));

        ShapeDrawable progress = new android.graphics.drawable.ShapeDrawable(
                new android.graphics.drawable.shapes.RectShape()
        );

        seekbar.setProgressDrawable(progress);

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bogdan, 2019-04-23
@bogdan_uman

Maybe it will be useful for someone, found the answer
seekbar.setSplitTrack(false);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question