php短视频源码,kotlin计时器实现的相关代码
package com.airiche.sunchip.utils
import android.os.CountDownTimer
import android.os.Looper
import android.util.Log
import com.airiche.sunchip.app.SpeechApp
internal class MyCountUnick(millisInFuture: Long, countDownInterval: Long) : CountDownTimer(millisInFuture, countDownInterval) {
private var TAG: String = "MyCountUnick"
override fun onTick(millisUntilFinished: Long) {
Log.e(TAG, "倒计时中====" + millisUntilFinished)
}
override fun onFinish() {
//倒計時結束如果狀態還沒有改變,那麼就是說不說話了 可以開始退出了
Log.e(TAG, "倒计时结束====")
}
companion object {
var myCountUnick: MyCountUnick? = null
val mMillisInFuture = 8 * 1000L
val mCountDownInterval = 1000L
fun setStartMyCount() {
if (myCountUnick != null) {
myCountUnick!!.cancel()
}
myCountUnick = MyCountUnick(mMillisInFuture, mCountDownInterval)
myCountUnick!!.start()
}
}
}
以上就是
php短视频源码,kotlin计时器实现的相关代码, 更多内容欢迎关注之后的文章