https://github.com/itvincent-git/quartz-countdown
android countdown tools enhanced the framework countdown
https://github.com/itvincent-git/quartz-countdown
android countdown
Last synced: 13 days ago
JSON representation
android countdown tools enhanced the framework countdown
- Host: GitHub
- URL: https://github.com/itvincent-git/quartz-countdown
- Owner: itvincent-git
- Created: 2017-06-28T07:28:52.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T08:48:50.000Z (about 7 years ago)
- Last Synced: 2025-07-20T00:12:33.398Z (11 months ago)
- Topics: android, countdown
- Language: Java
- Homepage:
- Size: 126 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# CountDownTimer 安卓精准倒计时器
Than the system comes with CountDownTimer made the following enhancements:
1. Support WeakReference the listener, to avoid memory leaks.
2. Self-correction heartbeat error, there will not be more and more problems heartbeat interval, to avoid jumping seconds phenomenon.
3. The release () method can release the strongly referenced listener.
## Sample
```
private QuartzCountdown mCountdown;
public void startCountdown() {
mCountdown = new QuartzCountdown.QuartzCountdownBuilder()
.durationMs(60000).intervalMs(1000).listener(this, true).build();
mCountdown.start();//start count down
}
...
@Override
public void onTic(QuartzCountdown quartzCountdown, long remainMs) {
//invoke every intervalMs
int remainSecond = Math.round(remainMs / 1000f)
}
@Override
public void onStopped(QuartzCountdown quartzCountdown) {
//invoke after durationMs or stop()
}
```
## 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.itvincent-git:quartz-countdown:1.0.0'
}
```