Coder Social home page Coder Social logo

Comments (11)

vinaygaba avatar vinaygaba commented on July 4, 2024

@biddster I really like this idea! Can u give me certain scenarios where this should fire. Should it fire only when all the values are entered ? Or is there something else you are looking at?

from creditcardview.

biddster avatar biddster commented on July 4, 2024

I'm thinking of the edit scenario. If the user starts changing the expiry date to something invalid, I think I would want to know immediately so that I can disable an update button. What do you think?

from creditcardview.

vinaygaba avatar vinaygaba commented on July 4, 2024

I'm thinking on the lines of how generic could these invalid conditions be. Or is it something that should be customizable by the users of this library. Putting some thought behind this.

from creditcardview.

biddster avatar biddster commented on July 4, 2024

I suspect that's something the library users would want to decide. Perhaps we just have a listener like this which fire on every edit?

interface CreditCardListener {
    void onCardNumberChanged();
    void onCardHolderChanged();
    void onExpiryDateChange();
    void onCvvChanged();
}

Would that suffice for most folks? I think it would for me.

from creditcardview.

vinaygaba avatar vinaygaba commented on July 4, 2024

Yes that way we let the developer handle whatever checks/validation/etc they might want to do. This makes sense and could be very useful. Will try to complete this today!

from creditcardview.

biddster avatar biddster commented on July 4, 2024

I forgot to mention that I believe it's possible to directly reference the fields in the view. So one could actually add their own text changed listeners to the credit card view.

from creditcardview.

vinaygaba avatar vinaygaba commented on July 4, 2024

Ah! Does it make this issue irrelevant? I mean is it even needed now?

from creditcardview.

biddster avatar biddster commented on July 4, 2024

Let me report back and I'll see how well it works. If it's workable, I'll close.

from creditcardview.

vinaygaba avatar vinaygaba commented on July 4, 2024

Great! Thanks!

from creditcardview.

biddster avatar biddster commented on July 4, 2024

Seems to work fine, perfectly workable. Closing.

from creditcardview.

vinaygaba avatar vinaygaba commented on July 4, 2024

Awesome!

from creditcardview.

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.