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

How can I set hint "telephone" until my edit text hasn't focus, or untill I dont click on my edit text??? #35

Closed
serjTi opened this issue Jun 21, 2017 · 1 comment
Assignees
Labels

Comments

@serjTi
Copy link

serjTi commented Jun 21, 2017

Hi! Thank you for your library! I have a question! How can I set hint "telephone" until my edit text hasn't focus, or untill I dont click on my edit text???

@taflanidi taflanidi self-assigned this Jun 21, 2017
@taflanidi
Copy link
Collaborator

Hi @serjTi! Thanks for your question.

I assume you are aware of the SDK reference for the EditText component and its setHint() method in particular.

According to the README example, you may want to set a MaskedTextChangedListener instance as a OnFocusChangeListener for your text field by calling

editText.setOnFocusChangeListener(listener);

— this way, you'll be able to use an "autocomplete" option whenever your text field gets focus in order to put prefix symbols before the user input.

First of all, It's not a necessary call.
Second, you may want to track an OnFocusChange event by yourself AND have this functionality at the same time.

In this case, I'd recommend you to implement a decorator over the MaskedTextChangedListener instance with the interface of OnFocusChangeListener — and then put your decorator in place of the OnFocusChangeListener.

It looks like an overkill for a simple hint change, though.

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

No branches or pull requests

2 participants