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

Layout broke with new material components #74

Open LipeDuoli opened 5 years ago

LipeDuoli commented 5 years ago

General information

Issue description

Using the new material components, the 2 new variants of EditText layout is a little broke. card_form_FilledBox card_form_OutlinedBox

quinnjn commented 5 years ago

I made a sample app to try this: https://github.com/quinnjn/android-card-form-issue-74

Using the latest stable, and alpha versions of material didn't show any changes to CardForm, but I think I'm missing the details. Can you provide a PR to that above example repository to put CardForm in the problematic state?

LipeDuoli commented 5 years ago

Hi @quinnjn , PR done.

alashow commented 4 years ago

@quinnjn Apparently it's because of the theme. It works as expected with appcompat themes, but not material components themes.

In your sample, the app theme is set to Theme.AppCompat.Light.DarkActionBar and the problem occurs when the theme is set to theme like Theme.MaterialComponents.Light.

alashow commented 4 years ago

Can be fixed by overriding bt_text_input_layout style and extending legacy input layout style Widget.Design.TextInputLayout:

<style name="bt_text_input_layout" parent="@style/Widget.Design.TextInputLayout">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginTop">12dp</item>
        <item name="android:accessibilityLiveRegion" tools:targetApi="kitkat">polite</item>
</style>
asknask commented 3 years ago

Can confirm this problem exists, and renders the form useless frankly. Tried the fix me mentioned above and it works.

NissanRayappu5235 commented 1 year ago

I couldnt overwrite to change the text color inside of textfield.mine remains in white color

NissanRayappu5235 commented 1 year ago

image