-
Notifications
You must be signed in to change notification settings - Fork 119
Wrong formatting when letters mask used [___] #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @kvrus, You are making a surprisingly big statement there without addressing the root causes. First of all, what makes you think you understood Now please, kindly set |
Oh, I had to override this method almost exactly as above.
Problem is before is just the number of replaced characters, but there is also a count. Following overriding resolved all the cursor issues:
That was quite ad hoc solution, but you definitely could look into that line closer and probably will be able to resolve one of "Known issues". |
Hi @yatsinar!
To be honest, your solution sounds almost nothing like the proposal above. Which makes it a perfect candidate for a pull request. P.s. When count > 0 and before > 0 — that's a replacement, not an insertion. You replace selected text with a button press or by pasting from the clipboard. |
Yeah, sure, replacement) |
@yatsinar, |
It works well for digits, but for letters, there is one issue:
For example mask is [____]
when you type the second character it will turn cursor to the start of the line, so new chars will appear from zero position.
This is because isDeletion defined in wrong way. I suggest using this method instead
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
isDeletion = p2 > p3
this.listener?.beforeTextChanged(p0, p1, p2, p3)
}
I can't make PR, so will wait for the fix)))
The text was updated successfully, but these errors were encountered: