uknownothingsnow / CircleProgress

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

CircleProgress start angle #51

Closed guyzk closed 7 years ago

guyzk commented 8 years ago

Is it possible to modify the CircleProgress to start from the top instead of from a 90 degree angle

DhavalsShah commented 8 years ago

Hi guyzk, try android:rotation attribute. It works great in DonutProgress. So, I think it should also work with CircleProgress as well. Usage: android:rotation="rotation of the view, in degrees. " You can also use setRotation(float) method if you want to rotate your view programatically. Try that. Hope this info helps.

nish-d commented 8 years ago

That rotates the text inside too. Is there some other solution?

nish-d commented 8 years ago

One way could be to set the progress as (100 - required progress). And change the finished_color and unfinished_color appropriately. For example, if you want to display 20% progress, set the progress to 80% and swap the colors for finished and unfinished progress.

DhavalsShah commented 8 years ago

@nish-d, I agree it rotates the text inside too, But I have solved that one by putting an attribute of custom:circle_text_color="@android:color/transparent",that makes the default text to transparent(i.e that user can not see) and then I put my own textview inside the progressbar using the framelayout. so its override the default rotated text, so user can see only the our textview which is inside the framelayout.

<FrameLayout>
 <CircleProgress custom:circle_text_color="@android:color/transparent"></CircleProgress>
<TextView android:text="20%"></TextView>
</FrameLayout>

Hope this helps you.

nish-d commented 8 years ago

This is certainly an innovative solution. Also I just found out there is a method, setStartingDegree(), that does the same.

hossain-khan commented 8 years ago

@lzyzsd I see attr: donut_circle_starting_degree & setStartingDegree(int startingDegree) in master-branch

But this is not available in 1.1.0 release in maven central repository is there any plan to publish new version with these changes & features?

Related Issues

uknownothingsnow commented 7 years ago

@amardeshbd please use jitpack.io, I havent update mvn center for a long time