Skip to content

Base on android.os.CountDownTimer - Format: hh:mm:ss:ms. 基于Android原生CountDownTimer写的简单倒计时,精确到毫秒

Notifications You must be signed in to change notification settings

jyjiawohao/SimpleCountDownTimer

 
 

Repository files navigation

SimpleCountDownTimer

  • A simple h,min,sec and ms count down timer.
  • Author: Luo Guowen Email:[email protected]

image

  • Setup

    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'
          	}
    
  • Usage

    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();
    
  • Other methods

    synchronized final CountDownTimer start(); Start the countdown.

    final void cancel(); Cancel the countdown.

About

Base on android.os.CountDownTimer - Format: hh:mm:ss:ms. 基于Android原生CountDownTimer写的简单倒计时,精确到毫秒

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%