question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android - CardForm wouldn't accept style on light themed app

See original GitHub issue

Describe the bug Using CardForm element on android, when having the app on light theme (Theme.MaterialComponents.Light.NoActionBar), when using the app on a device using dark mode the input text will stay white, making it invisible.

adding a black background only for this form is of course not an option, since it will not go with the rest of the app.

we cannot look into the source code of the elements used, so changing them to fit the app design is also not an option.

how can we tap into the style of those components?

To Reproduce Steps to reproduce the behavior:

  1. Add the library to your app like advised in the library readme file.
  2. Add material components to the app main style <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
  3. Add card form element to your component : <CardForm onFormComplete={card => { }} style={{ height: Platform.OS === "ios" ? 200 : 300, }} cardStyle={{}} />
  4. run the app on android device being set to dark mode.

Expected behavior The component will catch the main theme to be “light” and accordingly, use light theme color, with no regards to the device dark/light mode.

Screenshots This is how it looks in iOS : (expected behaviour) Screen Shot 2022-01-10 at 18 35 10

this is how it looks in android: Screen Shot 2022-01-10 at 18 35 46

Smartphone (please complete the following information):

  • Device: Galaxy S20
  • OS: android 11
  • Browser NA
  • Version NA

PS: I couldn’t find any documentation on how to tackle design on this component. if you can reference me please to a documentation on the matter, so I can make the android styling more matching to our app style, that would be greatly helpful

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:7

github_iconTop GitHub Comments

2reactions
james-chegecommented, Jan 19, 2022

Similar issue on iOS but vice versa. When the phone is set to a dark theme, the text and placeholders are not visible.

1reaction
remonh87commented, Jan 18, 2022

we observe the same on the flutter_stripe library. There is no way to configure the text color at the moment. Would be great to have this fixed since the widget is quite difficult to use now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styles and Themes - Android Developers
Styles and themes on Android allow you to separate the details of your app design from the UI structure and behavior, similar to...
Read more >
Fatal error (use theme.appcompat), even though I am using ...
All of your themes (that want an Action Bar/Toolbar) must inherit from Theme.AppCompat. There are variants available, including Light and NoActionBar.
Read more >
Developing themes with style (Android Dev Summit '19)
The Android theming system is powerful, but easy to misuse. Proper use of it can make your layouts easier to maintain and support...
Read more >
What's your text's appearance? - Medium
When styling text in Android apps, TextView offers multiple attributes and different ways to apply them. You can set attributes directly in ...
Read more >
Android Development Tutorial: Lollipop Material Design
A theme is a style applied to an entire Activity or application. ... run on an Android Lollipop AVD displaying the Material Light...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found