Created
October 12, 2021 18:32
-
-
Save masoudkarimi/608f4b05f3a83b728304299cda0c224f to your computer and use it in GitHub Desktop.
Adding TextWatcher
This file contains hidden or 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
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