stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

[Question] How can we set the CardMultilineWidget edit text hint color

Open Henry7604 opened this issue 2 years ago • 9 comments

Summary

Card number、Expiry、CVC、Postal Code hint not showing, But adjust the version to 17.2.0 and it will be able to show.

Android version

Android 13

Impacted devices

Samsung A52

Installation method

Dependency installed through gradle.

Dependency Versions

implementation 'com.stripe:stripe-android:20.24.1'

Screenshot

934527

Henry7604 avatar May 03 '23 02:05 Henry7604

Hi @Henry7604, thanks for opening this issue. Can you verify if you see this issue with other phones or emulators? That would help. Additionally, it would be helpful to see some code samples, such as the XML layout and how you are inflating this view.

I tried reproducing this issue on my Samsung device, but didn't see a problem. Let me know what you find, thank you!

jameswoo-stripe avatar May 04 '23 17:05 jameswoo-stripe

Hi @jameswoo-stripe, I used other devices and found the same problem, below is the device information and XML and gradle

device info: OPPO A53, Android 11 2023050501 2023050502

Henry7604 avatar May 05 '23 01:05 Henry7604

@Henry7604 I used the code sample you provided in a new Android project and I am still unable to reproduce this issue.

Could you please share your sample application in a github repo? Maybe there is something else going on. I don't have access to an Oppo or Samsung A52 either. Would you please try testing this on an emulator and let me know what happened?

jameswoo-stripe avatar May 05 '23 17:05 jameswoo-stripe

I also encountered the above issue on the Samsung Galaxy S20 FE5G phone, where Card number, Expiry, and CVC do not display Hint when there is no focus by default

implementation 'com.stripe:stripe-android:20.15.1'

fujiuhongnew avatar May 12 '23 08:05 fujiuhongnew

Screenshot_20230512_163927

fujiuhongnew avatar May 12 '23 08:05 fujiuhongnew

Screenshot_20230512_164618

fujiuhongnew avatar May 12 '23 08:05 fujiuhongnew

WechatIMG56

fujiuhongnew avatar May 12 '23 08:05 fujiuhongnew

Hi @jameswoo-stripe , I found the reason for this problem, you need to enable dark mode on your device, and remove your value-night/themes.xml, because the APP we developed does not support dark mode, so the default background is white.

The tested emulator is Pixel 5 API 31

Henry7604 avatar May 24 '23 03:05 Henry7604

@Henry7604 @fujiuhongnew

The CardMultiLineWidget was designed to support dark themes, so we need to provide colors for both dark and non-dark themed apps.

A quick workaround for your apps, since you might not support dark theme is to set the default night mode to none:

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)

See this stackoverflow for more information.

Is it possible to add dark theme to your apps?

Another option is to override our styles with your own.

jameswoo-stripe avatar May 24 '23 19:05 jameswoo-stripe

@Henry7604 We haven't heard from you in a bit, so we're going to close this issue. Please reopen if needed!

jaynewstrom-stripe avatar Jun 17 '24 18:06 jaynewstrom-stripe