Skip to content
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

Non-removable prefix #63

Open
milk-machine opened this issue Oct 19, 2018 · 5 comments
Open

Non-removable prefix #63

milk-machine opened this issue Oct 19, 2018 · 5 comments
Assignees

Comments

@milk-machine
Copy link

In some cases I need non-removable prefix. Add this feature, please :)

@CoolMind
Copy link

@milk-machine, how do you want to see a mask and a result of removing symbols?

@taflanidi
Copy link
Collaborator

taflanidi commented Oct 30, 2018

Hey @milk-machine!
Thanks for your suggestion.

I'll keep this feature request, though I can't say this feature will come out soon. It's a little bit controversial, plus the implementation raises lots of design questions, including the one above by @CoolMind

@taflanidi taflanidi self-assigned this Oct 30, 2018
@TurKurT656
Copy link

yes this is very needed, ThnQ

@dmersiyanov
Copy link

dmersiyanov commented Jul 24, 2020

Hi, @taflanidi is there any update?

P.S. As there is no official solution I would like to introduce a shortcut. Just override afterTextChanged method in MaskedTextChangedListener:

override fun afterTextChanged(edit: Editable?) {
    val text = field.text.toString()
    if (!text.startsWith(nonRemovePrefix)) {
        setText(nonRemovePrefix, field)
    } else {
        super.afterTextChanged(edit)
    }
}

https://gist.github.com/dmersiyanov/2b8f6f9472969fc0dd23749ec8f5c8f0

@taflanidi
Copy link
Collaborator

I'll look into pulling this into the core, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants