I am trying to create my custom progress bar for an Android App.
I created a drawable with a path and two concentric circles. The idea is
that the red part will fill up the circumference of the circle and when
it reaches near the 0 degree mark it will restart again. The problem is that
the circle fills up nicely how it should, but it doesn't restart.
Controlling this behavior is a ValueAnimator which somehow invalidates the drawable which resides on an image-view. Here's a picture of what the drawable should try to accomplish. 
I have tried my best to tweak the code for this Value-Animator, but It does not do what is supposed to. Here is the code of the Value-Animator:
ValueAnimator val = ValueAnimatro.ofInt(0,360);
val.setDuration(1000);
val.setRepeatCount(ValueAnimator.INFINITE);
val.setRepeatMode(ValueAnimator.REPEAT);
val.addUpdateListener(...){
public void onAnimationUpdate(ValueAnimator c){
int a = (int)updatedAnimation.getAnimatedValue();
if(a!=0){
float b = 1f*a;
ProgressShow.sweepAngle = b;
image45.invalidateDrawable(image45.getDrawable());
}
Now, ProgressShow is the name of the drawable class and ProgressShow.sweepAngle is a variable that is used inside the onCanvas method when drawing the path. It is used as follows:
path.arcTo(0,sweepAngle);
the sweepAngle variable is constantly changed inside the onAnimationUpdate method of the ValueAnimator.
Any ideas why the red ring stops near 360 degrees, when it should restart based on the nature of the ValueAnimator being infinite repeat count and a repeat mode of restart.
thanks for any advice