package com.mints.goodmoney.utils;

import android.annotation.SuppressLint;
import android.os.CountDownTimer;
import android.widget.TextView;

public class CountDownUtil extends CountDownTimer {
    private TextView tv;//

    /**
     *
     * @param millisInFuture
     * 			倒计时时间
     * @param countDownInterval
     * 			间隔
     * @param tv
     * 			控件
     */
    public CountDownUtil(long millisInFuture, long countDownInterval,
                         TextView tv) {
        super(millisInFuture, countDownInterval);
        this.tv = tv;

    }

    @SuppressLint("NewApi")
    @Override
    public void onTick(long millisUntilFinished) {
        tv.setText(millisUntilFinished / 1000 + "s");//设置时间
    }

    @SuppressLint("NewApi")
    @Override
    public void onFinish() {

    }
}
