alwaysDark style for PaymentSheet not functional in Android apps - system theme always applied
See original GitHub issueDescribe the bug
When trying to force dark theme using style='alwaysDark'
in initPaymentSheet
, Payment Sheet in Android apps do not actually always use dark theme. Instead, they end up getting the system light vs dark theme applied, you can toggle it via system settings to see it switch.
To Reproduce Steps to reproduce the behavior:
- Run the example app included in this repository. Note that PaymentsUICompleteScreen and PaymentsUICustomScreen both include
style='alwaysDark'
. - In the example app, go to Accept a Payment > Prebuilt UI (either version). Press the button (top on custom/multi-step).
- Notice on Android that the PaymentSheet theme matches the system theme,
alwaysDark
is not honoured. iOS PaymentSheet adheres to provided theme.
Expected behavior
Android PaymentSheet should always be dark when style='alwaysDark'
is set.
Screenshots
In all examples, style='alwaysDark'
is set.
Android with light system theme
Android with dark system theme
iOS
Smartphone (please complete the following information):
- Device: Pixel 4 AVD
- OS: Android 10
- Browser N/A
- Version SDK 29 on virtual device per RN instructions
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Dark theme - Android Developers
Dark theme applies to both the Android system UI and apps running on the device. ... Your themes and styles should avoid hard-coded...
Read more >Use Dark theme in your apps - Google Play Help
Dark theme can be easier to see, and it can save battery on some screens. Not all apps offer multiple color schemes. Turn...
Read more >How to Enable the New Full Dark Mode in Google Maps on ...
Then, the dark mode comes with three different settings: always light, always dark, and following the system mode. While switching it to always...
Read more >How to Enable Dark Mode in Snapchat - Alphr
Scroll Down and choose “App Appearance.” Choose “Always Dark.” How to Use Dark Mode in Snapchat on Android. Unfortunately, Snapchat hasn't ...
Read more >How to disable night mode in my application even if night ...
Android -Q will out any time soon and all the app will get affected from the system settings . You can look for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the responses!
We’re looking into customization changes and will keep dark mode toggling in mind. In the mean time, it does seem possible that forcing dark mode at an application level is a solution for those that want to match. According to this you can put this line in your launcher activity’s
onCreate
and force darkmode.I’m hoping that is a good solution/bandaid while we work on more sophisticated customization.
@brendanm-stripe This is not something that the android currently supports, but we do have it in our backlog. I will post an update when we have it complete.