Created
July 23, 2019 10:03
-
-
Save Nublo/e2398904e2c9dcd4b17bb1ae0721381b to your computer and use it in GitHub Desktop.
This file contains 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
class DateEditText : AppCompatEditText(context, attrs, defStyleAttr) { | |
private var canChange: Boolean = false | |
private var actualText: StringBuilder = StringBuilder() | |
override fun onSelectionChanged(selStart: Int, selEnd: Int) { | |
super.onSelectionChanged(selStart, selEnd) | |
if (!canChange) return | |
canChange = false | |
setSelection(actualText.length) | |
canChange = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment