vinaygaba / CreditCardView

💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
797 stars 143 forks source link

More granular control over editable state #7

Closed biddster closed 9 years ago

biddster commented 9 years ago

I'd really like to see the editable state being applied to individual fields rather than the card as a whole.

E.g. Our app only allows users to update expiry of cards once created.

vinaygaba commented 9 years ago

This sounds like an interesting idea. One that I would like to give the users of this library. So would you like to see more attribute fields like app:IsCardNameEditable,app:IsExpiryDateEditable ....... Or do you have any other suggestions of implementing this?

biddster commented 9 years ago

That's just perfect, exactly what I'd like to see.

vinaygaba commented 9 years ago

Great. I think I can do this :)

vinaygaba commented 9 years ago

@VenomVendor I wanted your opinion about this. Does it make sense to deprecate the isEditable attribute and replace it with 3 different attributes(isCreditCardEditable,isCard........) to give more granular control or should I keep the isEditable attribute as is and along with that add 3 new attributes?

VenomVendor commented 9 years ago

@vinaygaba It's good to have both. I was planning to take this, but you should have already started.

vinaygaba commented 9 years ago

@VenomVendor Yup I started working on this. Was thinking about what the precedence logic should be like.

vinaygaba commented 9 years ago

@biddster I have added support for more granular control of fields. Will be releasing the new version of the library today and updating the documentation accordingly. Closing the issue :)

vinaygaba commented 9 years ago

@biddster This feature is implemented as part of v1.0.3 and I want you to try it out. I have not updated the documentation yet as I am trying to include the flip animation feature as part of the 1.0.3 release. But v1.0.3 is available on maven for you to use as of now and you can try it out. There are 3 additional attributes now: isCardNumberEditable,isCardNameEditable and isExpiryDateEditable.

isEditable field is still available but the granular attributes will have precedence over this field for the respective fields. Do try it out and do let me know what u think.