倒计时+1

This commit is contained in:
zxj
2025-07-25 16:33:50 +08:00
parent c0a628c51f
commit 8780f5d463
2 changed files with 2 additions and 2 deletions
@@ -20,7 +20,7 @@ class PlateCabinetFullFragment :
fun initCountTime() { fun initCountTime() {
object : CountDownTimer(totalTimeInMillis, 1000) { object : CountDownTimer(totalTimeInMillis, 1000) {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
binding.tvAutoClose.text = "${(millisUntilFinished / 1000).toInt()}秒后返回主屏" binding.tvAutoClose.text = "${(millisUntilFinished / 1000).toInt() + 1}秒后返回主屏"
} }
override fun onFinish() { override fun onFinish() {
@@ -55,7 +55,7 @@ class PlateOpenFragment :
fun initCountTime() { fun initCountTime() {
object : CountDownTimer(totalTimeInMillis, 1000) { object : CountDownTimer(totalTimeInMillis, 1000) {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
binding.tvAutoClose.text = (millisUntilFinished / 1000).toInt().toString() binding.tvAutoClose.text = ((millisUntilFinished / 1000).toInt() + 1).toString()
} }
override fun onFinish() { override fun onFinish() {