Skip to content

Instantly share code, notes, and snippets.

@Flywith24
Created February 27, 2020 05:45
Show Gist options
  • Save Flywith24/aa820637f38bfc4e429f2aab857e62f4 to your computer and use it in GitHub Desktop.
Save Flywith24/aa820637f38bfc4e429f2aab857e62f4 to your computer and use it in GitHub Desktop.
kotlin协程验证码倒计时
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