Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a 1.1.0+ Material Components theme breaks CardInputWidget layout in 13.0.0 #2053

Closed
utwyko opened this issue Jan 14, 2020 · 1 comment · Fixed by #2055
Closed

Using a 1.1.0+ Material Components theme breaks CardInputWidget layout in 13.0.0 #2053

utwyko opened this issue Jan 14, 2020 · 1 comment · Fixed by #2055
Assignees
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@utwyko
Copy link

utwyko commented Jan 14, 2020

Summary

Version 13.0.0 messes up the layout of the CardInputWidget when using a theme inheriting from MaterialComponents while having a dependency on MaterialComponents 1.1.0-rc01. My guess that this was caused by the changes in #2029.

Using the stable MaterialComponents 1.0.0 version works correctly. I think this is because the full material theming support is included only in 1.1.0.

I can think of two possible solutions:

  • Make this widget work nicely with Material Themes
  • Override the material theme and use a consistent default stripe style so that app specific material theme is not used in the widget.
12.7.0 13.0.0
stripe_material_theme_12_7_0 stripe_material_theme_13_0_0

Code to reproduce

  1. Add implementation "com.google.android.material:material:1.1.0-rc01 to the dependencies of the example app.
  2. Change the example app theme to inherit from MaterialComponents.Light: <style name="AppTheme" parent="Theme.MaterialComponents.Light">.
  3. Run the app and open the Create a Card Token example

Android version

Tested on 8.0, but probably on every version

SDK version

13.0.0

@mshafrir-stripe mshafrir-stripe self-assigned this Jan 14, 2020
@mshafrir-stripe mshafrir-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Jan 14, 2020
mshafrir-stripe added a commit that referenced this issue Jan 14, 2020
`com.google.android.material:material:1.1.0-rc01` breaks
`CardInputWidget` styling. Fix this by explicitly setting
a style that extends `Widget.Design.TextInputLayout`.

Fixes #2053
@mshafrir-stripe
Copy link
Collaborator

@utwyko thanks for filing. I put up a PR to fix this issue.

mshafrir-stripe added a commit that referenced this issue Jan 14, 2020
`com.google.android.material:material:1.1.0-rc01` breaks
`TextInputLayout` styling. Fix this by explicitly setting
a style that extends `Widget.Design.TextInputLayout`.

Fixes #2053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants