Created
July 12, 2017 05:01
-
-
Save nesterchung/0ae102c5ef19fb75fa7967c56dcccb46 to your computer and use it in GitHub Desktop.
CountDownTimer with progressBar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CountDownTimer countDownTimer = new CountDownTimer(TIME_MILLIS, 100) { | |
@Override | |
public void onTick(long millisUntilFinished) { | |
double i = (1 - millisUntilFinished / (double) TIME_MILLIS) * 100; | |
progressBar.setProgress((int) i); | |
} | |
@Override | |
public void onFinish() { | |
progressBar.setProgress(100); | |
} | |
}; | |
countDownTimer.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment