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] "Enter address manually" button has an unexpected color #7743

Open
kit0kat opened this issue Dec 24, 2023 · 1 comment
Open

[BUG] "Enter address manually" button has an unexpected color #7743

kit0kat opened this issue Dec 24, 2023 · 1 comment
Labels

Comments

@kit0kat
Copy link

kit0kat commented Dec 24, 2023

Hi,

I'm using the following appearance for my address sheet:

PaymentSheet.Appearance(
    colorsLight = PaymentSheet.Colors(
        surface = Color(0xFFFEFBFF), // almost white
        component = Color(0xFFE2E1EC), // grey
        // ...
    ),
    colorsDark = PaymentSheet.Colors(
        surface = Color(0xFF1B1B1F),
        component = Color(0xFF45464F),
        // ...
    ),
)

In dark mode this works fine:

In light mode the "Enter address manually" button is shown in pink, but not I'm not even using this color in my theme.

I found the follow code in the SDK:

val background = if (isSystemInDarkTheme()) {
    MaterialTheme.stripeColors.component
} else {
    MaterialTheme.stripeColors.materialColors.surface.darken(0.07f)
}

Source: https://github.com/stripe/stripe-android/blob/ddc344ee2e80eb35f84b28a3bb3501377b9de840/paymentsheet/src/main/java/com/stripe/android/paymentsheet/addresselement/AutocompleteScreen.kt#L96C13-L100C14

This is very unexpected.

If a component color is set in the appearance configuration, why is it only applied in dark mode?

@kit0kat kit0kat added the bug label Dec 24, 2023
@tillh-stripe
Copy link
Collaborator

Hi @kit0kat 👋 Yep, that doesn’t look right.

I reached out to the folks that built this screen. We apparently use this custom logic to make sure that the button stands out in light mode, as surface and component colors are usually the same in light mode. That being said, the button should obviously not turn pink like this.

Can you provide some more context about your usage? If you can provide a small sample app where the issue is reliably reproducible, that would be ideal. I’m trying to have this issue show up in our AddressElementExampleActivity, but I’m not seeing it.

@tillh-stripe tillh-stripe self-assigned this Jan 10, 2024
@tillh-stripe tillh-stripe removed their assignment Mar 7, 2024
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

2 participants