How do I remove radius corners programmatically?

I want to programmatically remove the radius of a corner. I do not know how to do that.

I am creating a ProgressBarCompat to change the color of the progress bar with colorAccent, but I have no idea how to remove the corner radius in progressBarDrawable in android api below 11.

Drawable link: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/drawable/progress_horizontal.xml

Can I do it?

I use this to make progress available:

LayerDrawable drawable = (LayerDrawable) getProgressDrawable();
Drawable progressDrawable = drawable.findDrawableByLayerId(android.R.id.progress);
// and now i detect sdk version and call method to remove corners on this drawable (progressDrawable).

      

+3
android


source to share


No one has answered this question yet

Check out similar questions:

3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
2510
How to persist android activity state by persisting instance state?
2284
How can I fix 'android.os.NetworkOnMainThreadException'?
1002
Grid motion detection
879
How do I convert Drawable to Bitmap?
219
Android SDK Manager does not install components
eleven
How to adjust Android SeekBar drawing progress programmatically
2
XML drawable: corner radius not working
0
How can I programmatically adjust the accent color of a hatch?
0
Object animation removes drawing capabilities



All Articles
Loading...
X
Show
Funny
Dev
Pics