-
A simple h,min,sec and ms count down timer.
-
Author:Luo Guowen
-
Email:luoguowen123@qq.com
-
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();
-
The number of millis in the future from the call to start() until the countdown is done and onFinish() is called.
long totalTime;
The interval time of count down.
long intervalTime;
A text view used to display count down time.
TextView textView;
-
synchronized final CountDownTimer start(); Start the countdown.
final void cancel(); Cancel the countdown.
-
Notifications
You must be signed in to change notification settings - Fork 6
lgw666/SimpleCountDownTimer
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Based on android.os.CountDownTimer - Format: hh:mm:ss:ms. 基于Android原生CountDownTimer写的简单倒计时,精确到毫秒
Resources
Stars
Watchers
Forks
Packages 0
No packages published