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

[BUG] Cursor color not updated with PaymentSheet.Appearance #8021

Open
david-tixr opened this issue Feb 29, 2024 · 3 comments
Open

[BUG] Cursor color not updated with PaymentSheet.Appearance #8021

david-tixr opened this issue Feb 29, 2024 · 3 comments
Labels

Comments

@david-tixr
Copy link

Summary

I am forcing light theme in my PaymentSheet, regardless of the device's Dark mode settings, using the method recommended by the docs:

appearance = PaymentSheet.Appearance(
    colorsDark = PaymentSheet.Colors.defaultLight,
    colorsLight = PaymentSheet.Colors.defaultLight,
)

All the colors are correctly updated, EXCEPT the cursor color in the input fields: it remains either white or black, following the device's Dark mode rather than the PaymentSheet.Appearance I've set.
My expectation is that: either the cursor color should be directly customizable in PaymentSheet.Colors, or it should use the onComponent color.

Code to reproduce

I've forked this repo: https://github.com/david-tixr/stripe-android and added only the few lines mentioned above (commit: david-tixr@30b1faa).

  1. Checkout branch bug/cursor-color
  2. Set your device to Dark mode
  3. Run paymentsheet-example
  4. Select the first option (PaymentSheet)
  5. Click Buy

Android version

Android 14, possibly lower versions too

Installation method

Gradle dependency: com.stripe:stripe-android:20.38.0

Dependency Versions

kotlin: 1.9.22
stripe-android: 20.38.0
Android Gradle Plugin: 8.2.2
Gradle: 8.2

Screenshots

❌ Device in Dark mode -- cursor is white on white, barely visible

✅ Device in Light mode -- cursor is black on white

@david-tixr david-tixr added the bug label Feb 29, 2024
@david-tixr
Copy link
Author

Note: adding AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) in my Application class solves it.
But it feels like a workaround: I shouldn't have to set this globally and affect my whole app just to solve the cursor in Stripe activities.

@somesh-mesh
Copy link

Hi, I Wanted to fix this bug.

@ningkanggithub
Copy link

This bug affects the user experience and wants to expose an method to change the cursor color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants