Skip to content

Instantly share code, notes, and snippets.

@Nublo
Created July 23, 2019 10:01
Show Gist options
  • Save Nublo/f7b44b24bb356d62b710efb251e00634 to your computer and use it in GitHub Desktop.
Save Nublo/f7b44b24bb356d62b710efb251e00634 to your computer and use it in GitHub Desktop.
phoneNumber.setOnFocusChangeListener { _, hasFocus ->
countryCode.setBackgroundResource(background(hasFocus))
}
private fun background(hasFocus: Boolean) =
when (hasFocus) {
true -> R.drawable.phone_input_active
false -> R.drawable.phone_input_inactive
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment