VicMikhailau / MaskedEditText

It allows you to add a mask to EditText
Apache License 2.0
284 stars 50 forks source link

Fix addTextChangedListener listening 2 times #32

Closed professorDeveloper closed 1 year ago

professorDeveloper commented 1 year ago

Hello, I have 2 calls to the addtextChangeListener method. image why is that.

VicMikhailau commented 1 year ago

Hi, Looks like: your input + mask setup. Try to debug what and how changed here and in inner logic if needed.

Thanks.

professorDeveloper commented 1 year ago

can you help me please . I did not understand you. please I didn't even understand what the problem was.

VicMikhailau commented 1 year ago

Please check what you receive for the s: CharSequnce? on onTextChanged(). It can be your input + mask applying = expected behavior.

Unfortunately, there is no way to devote much time to the project. Please feel free to Fork the project and add Pull requests. Thanks a lot!

professorDeveloper commented 1 year ago

I would like to send an automatic request. I am trying to prevent the api from being sent twice.

professorDeveloper commented 1 year ago

. Please feel free to Fork the project and add Pull requests. Thanks a lot! I did not understand this

VicMikhailau commented 1 year ago

@professorDeveloper Please update MaskedEditText to 5.0.1

implementation("io.github.vicmikhailau:MaskedEditText:5.0.1")

And use new methods instead

mMaskedEditText.addMaskedTextChangedListener mMaskedEditText.doBeforeMaskedTextChanged mMaskedEditText.doOnMaskedTextChanged mMaskedEditText.doAfterMaskedTextChanged

or

maskedWatcher.addTextChangedListener

But it can lead to unexpected behavior in case of text changes. For your case I can suggest use pure solution like yourEditText.text.toString() before sent request.

Thanks.

professorDeveloper commented 1 year ago

thank you

VicMikhailau commented 1 year ago

Will be closed for now.