//倒计时实现
object : CountDownTimer(5 * 1000L, 1000) {
override fun onFinish() {
binding.inclLoginVerificationCode.llLoginUpdateTime.visibility =
View.GONE
binding.inclLoginVerificationCode.tvLoginYzmSend.visibility =
View.VISIBLE
}
override fun onTick(p0: Long) {
binding.inclLoginVerificationCode.llLoginUpdateTime.visibility =
View.VISIBLE
binding.inclLoginVerificationCode.tvLoginYzmSend.visibility = View.GONE
binding.inclLoginVerificationCode.tvUpdateTime.setText(String.format(resources.getString(R.string.login_verification_code_time), p0.div(1000)))
}
}.start()
android_基础_验证码倒计时实现
最新推荐文章于 2023-11-29 15:30:15 发布