I have a round progress bar, made with a drawable, with values from 0-100 (included). When I load my activity, I want to animate the progressbar being "filled" with values from 0 to my desidered value. I'm using a CountdownTimer for that.
The issue is, even though I set the value to 100, the max (or any other value), the progressbar doesn't get filled all the way. Here's my code:
seekbar = (ProgressBar) findViewById(R.id.progressBar);
seekbar.setMax(100);
final int desiredvalue=100;
CountDownTimer countDownTimer =
new CountDownTimer(1500, 20) {
int startingvalue=0;
public void onTick(long millisUntilFinished) {
float progressPercentage = (desiredvalue*20)/1500;
seekbar.setProgress(startingvalue+=progressPercentage);
}
@Override
public void onFinish() {
}
};
countDownTimer.start();
}
This is what's happening: Open me!