Created
September 19, 2020 17:46
-
-
Save masoudkarimi/50165c69c5d632444e37cc1f2249aaa8 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