Giter Club home page Giter Club logo

Comments (5)

thyrlian avatar thyrlian commented on May 13, 2024

Hi @boomsya , thanks for using AwesomeValidation and your valuable feedback.

Please correct me if I get it wrong:
I assume that you are using ViewPager, and I think you want to dismiss the sticky tooltip when scrolling to the other page. Then could you try to call mAwesomeValidation.clear(); when ViewPager.onScrollChanged?

Because to me, each developer's implementation differs, I can't guess beforehand what listener I should register the clear method to.

from awesomevalidation.

boomsya avatar boomsya commented on May 13, 2024

sorry for not good English :)
yes, you right

can tooltip slide(move) with TextEdit synchronous over screen?

but your answer really help me too

from awesomevalidation.

thyrlian avatar thyrlian commented on May 13, 2024

No problem :)

Now I completely understand the problem: the tooltip doesn't move along with the screen.

Hmmm, I'm afraid that we could do nothing about it. Since the tooltip is from Android's code: EditText.setError(CharSequence error). You can check this line here.

So I guess you'd better clear the validation onScrollChanged. But please be careful, only clear when you're sure the 2nd page is ready, not when user by accident move several pixels left or right.

Thanks and good luck :)

from awesomevalidation.

boomsya avatar boomsya commented on May 13, 2024

thanks for helping to me

can i ask just one question?
i have EditText fields and when user clear (for example) seond field - i have event:
yourage_input.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
mAwesomeValidation.validate(); <<<<-----------------
}
public void beforeTextChanged(CharSequence s, int start, int count, int after){}
public void onTextChanged(CharSequence s, int start, int before, int count){}
});

but user can delete text in first field, and go to second and delete text in second
and after that his enter valid number in first field and mAwesomeValidation.validate() return to me FALSE because second field empty (i added validator RegexTemplate.NOT_EMPTY)

can i check validation for concrete field? (when user fill first field valid - i should need set seekbar value from field)
i have fouded function "checkFields" but they check all ArrayList


at now i will do that:
private AwesomeValidation field1validator;
private AwesomeValidation field2validator;
private AwesomeValidation field3validator;

for split validating to peaces

from awesomevalidation.

thyrlian avatar thyrlian commented on May 13, 2024

Sorry that I just got time to read your comments.

To answer your question:

  • I didn't think about validating fields one by one, that's why the _checkFields_ method you found iterates all.
  • The reason I did it this way is because I believe that validating all fields at once is the most common use case. But you're right, sometimes we just want to trigger validation of one single field on its input change.
  • For the time being (based on current implementation), I think you did it right: instantiating one AwesomeValidation object per field, and validate them isolatedly.

Have fun playing with it :)

from awesomevalidation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.