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 127 forks source link

Display the keyboard purchase button when postal code and phone number are disabled #20

Closed bisonfute closed 7 years ago

bisonfute commented 7 years ago

Hi there and thanks for your library, it is great!

I use it this way

creditCardForm.cardRequired(true)
                .expirationRequired(true)
                .cvvRequired(true)
                .postalCodeRequired(false)
                .mobileNumberRequired(false)
                .actionLabel("DONE")
                .setup(AccountCreationActivity.this);

But the keyboard DONE button doesn't display when I am on the cvv edittext. Is there any way to do it ?

Regards.

lkorth commented 7 years ago

@bisonfute do you have a screenshot or any more info regarding the version of the card form you are using or the device you are seeing it on? Do note that the keyboard is not obligated to display this, if you're using a third party keyboard they may not ever display action labels like this.

The sample app that is include works just fine with the configuration you described and there are also tests for this scenario.

screenshot 2016-11-17 10 04 36
bisonfute commented 7 years ago

@lkorth thanks for your answer. I reproduce the issue using the sample app and configuring it like this

mCardForm.cardRequired(true)
                .expirationRequired(true)
                .cvvRequired(true)
                .postalCodeRequired(false)
                .mobileNumberRequired(false)
                .mobileNumberExplanation("Make sure SMS is enabled for this mobile number")
                .actionLabel(getString(R.string.purchase))
                .setup(this);

the result looks like this. image

The phone is a samsung S4 and the langage is set to french.

I tried to set the language to English(US) to this one and the result is the same :

image

bisonfute commented 7 years ago

The issue might come from the keyboard that is not the Android default one but a Samsung custom one. I confirm that on a Nexus simulator everything works fine.

lkorth commented 7 years ago

Yeah, it may just be the keyboard you're using is reading the IME options incorrectly. One thing you could try is changing how the IME options and action label is set to see if the keyboard is placing more importance on the options than the action label. It may be that removing the IME options will get the action label to display for you.

bisonfute commented 7 years ago

I will try this, ok, thanks. I'll let you know in this Github Issue what results I did get. For information, this keyboard is installed and set up by default on all Samsung Android devices.

bisonfute commented 7 years ago

I confirm the issue comes from the default samsung keyboard. I didn't find any workaround, so the best option is to deal with it and adapt UI. Thanks @lkorth !