uknownothingsnow / CircleProgress

CircleProgress, DonutProgress, ArcProgress
3.81k stars 921 forks source link

change the radius of DonutProgress #85

Open meshileya opened 7 years ago

meshileya commented 7 years ago

how can i change the size or radius of the com.github.lzyzsd.circleprogress.DonutProgress

hossain-khan commented 7 years ago

Size and radius both means the same thing for circle. Size is defined by the layout_width and layout_height - anything specific you are looking for?

Here is some discussion about start angle - https://github.com/lzyzsd/CircleProgress/issues/51#issuecomment-231376386

Also take a look at all the available properties from source code DonutProgress.java or attrs.xml

meshileya commented 7 years ago

thanks so much @amardeshbd i sincerely do appreciate...what i do like to ask is, since i added it as a dependency inside my build.gradle file, is there a way i can still tweak the library????

hossain-khan commented 7 years ago

Unfortunately no, once you add the library as jar, you can't modify the source. You have to use the exposed API or XML attributes to change widget values.

If you need specific component (eg. DonutProgress), you can just take the source code of that component. You might also have to take source from Util class used as helper.

meshileya commented 7 years ago

thanks for the reply @amardeshbd i do like to know the quickest way to get this done, if i want to make the percentage dynamic..like, representing this donutprogress bar with the data in my database, how best do you think this can be achieved pls

hossain-khan commented 7 years ago

There is public void setProgress(float progress) API in DonutProgress.java

Use that, it will dynamically update the UI.