Skip to content

Instantly share code, notes, and snippets.

@masoudkarimi
Created October 12, 2021 18:32
Show Gist options
  • Save masoudkarimi/608f4b05f3a83b728304299cda0c224f to your computer and use it in GitHub Desktop.
Save masoudkarimi/608f4b05f3a83b728304299cda0c224f 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