braintree / android-card-form

A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
MIT License
366 stars 128 forks source link

Makes possible to use date dialog without whole form #33

Closed mlykotom closed 7 years ago

mlykotom commented 7 years ago

Not sure if it's intentional, but I wanted to use not whole form but just the custom views (because it's easier than style the whole form).

Since the method is protected, I'm not able to show the dialog for selecting date. Workaround is to extend the view and override the method to be public. It's called the same way as from CardForm#setup(Activity) method.

lkorth commented 7 years ago

Thanks for the PR! I was about to merge it, but realized that setActivity was mostly a duplicate method and that there was some possible weird behavior if you never called setActivity and it defaulted to using the dialog for date entry.

Give my changes a look, they should still accomplish what you're looking for and prevent a few issues.

mlykotom commented 7 years ago

This is actually safer. I just looked to implementation of CardForm#setup(Activity activity) and saw the method.