Created
February 27, 2020 05:45
-
-
Save Flywith24/aa820637f38bfc4e429f2aab857e62f4 to your computer and use it in GitHub Desktop.
kotlin协程验证码倒计时
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewLifecycleOwner.lifecycleScope.launch { | |
send.isEnabled = false | |
for (i in 60 downTo 1) { | |
send.text = getString(R.string.login_resend, i) | |
delay(1000) | |
} | |
send.isEnabled = true | |
send.text = getString(R.string.login_send_code) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment