I'm trying to create a rounded square line progress bar to draw a progress around an image.
So far, I have the following XML which defines my rounded square line:
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="6dp"
android:color="@android:color/holo_green_light" />
<padding
android:left="5dp"
android:right="5dp"
android:bottom="5dp"
android:top="5dp" />
<corners android:radius="50dp" />
</shape>
I'm aware of this solution: https://github.com/mrwonderman/android-square-progressbar but I'm not interested in as the effect is not the one I want.
I've tried to create a plain circle on top of the rounded square line and tried to merge the two with PorterDuff, but so far I was also not able to create the progress bar effect. Drawing a pie of that circle to draw the progress.
I've also tried to create the rounded square programaticaly in case the XML inflating was considered as a plain image and all pixels were taken into account during the PorterDuff merge. But same result.
Drawable
class that will be used when callingsetProgressDrawable
– Merediandroid.graphics.drawable.Drawable
documentation, then try this simple customDrawable
– MeredisetProgress
again and again wuth different progress parameter? – MerediCanvas
API? – Meredi