Skip to content

Instantly share code, notes, and snippets.

@masoudkarimi
Created September 19, 2020 17:46
Show Gist options
  • Save masoudkarimi/50165c69c5d632444e37cc1f2249aaa8 to your computer and use it in GitHub Desktop.
Save masoudkarimi/50165c69c5d632444e37cc1f2249aaa8 to your computer and use it in GitHub Desktop.
Adding TextWatcher
etCardNumber.doAfterTextChanged { editable ->
if (editable == null) return
val paddingPx = etCardNumber.paint.measureText("X").toInt()
formatDebitCard(editable, paddingPx)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment