android-card-form
android-card-form copied to clipboard
Layout broke with new material components
General information
- SDK/Library version: 4.2.0
Issue description
Using the new material components, the 2 new variants of EditText layout is a little broke.

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?
Hi @quinnjn , PR done.
@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.
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>
Can confirm this problem exists, and renders the form useless frankly. Tried the fix me mentioned above and it works.
I couldnt overwrite to change the text color inside of textfield.mine remains in white color
