- A simple h,min,sec and ms count down timer.
- Author: Luo Guowen Email:[email protected]
-
Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
Step 2. Add the dependency:
dependencies { compile 'com.github.lgw666:SimpleCountDownTimer:1.1' }
-
Simple show :
new SimpleCountDownTimer(totalTime,textView).start();
Custom interval time:
new SimpleCountDownTimer(totalTime,intervalTime,textView).start();
Do something after finished:
new SimpleCountDownTimer(totalTime, tvDisplay).setOnFinishListener(new SimpleCountDownTimer.OnFinishListener() { @Override public void onFinish() { do something... } }).start();
-
synchronized final CountDownTimer start(); Start the countdown.
final void cancel(); Cancel the countdown.