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

[MaterialCheckBox] Ripples are red on Lollipop #1277

Closed
ataulm opened this issue May 6, 2020 · 3 comments
Closed

[MaterialCheckBox] Ripples are red on Lollipop #1277

ataulm opened this issue May 6, 2020 · 3 comments
Labels

Comments

@ataulm
Copy link
Contributor

ataulm commented May 6, 2020

Description:

When colorControlHighlight is a ColorStateList with theme attributes, MaterialCheckBox ripples are red on Lollipop:

v22 v29
light-before v23

Expected behavior:

See v29^

Fixing this would require tinting the background programmatically, using AppCompatResources to load colorControlHighlight, rather than using it from XML.

Source code:

In the app theme, override colorControlHighlight to point to a CSL:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:alpha="0.12" android:color="?attr/colorPrimary" />
</selector>

Android API version:
21,22

Material Library version:
1.1.0, 1.2.0-alpha06

Device:
Emulator

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

@ataulm ataulm added the bug label May 6, 2020
@dsn5ft
Copy link
Contributor

dsn5ft commented May 6, 2020

Hi @ataulm, unfortunately globally setting colorControlHighlight to a CSL with theme attributes is not a safe thing to do, because that attribute is used in many places by many widgets (framework, AppCompat, etc.), and it's not guaranteed that they all use AppCompatResources to load the attribute.

E.g., in this case, the loading of colorControlHighlight isn't in MaterialCheckBox. I think it's in AppCompatCheckBox, so you may be able to file an AppCompat bug.

@dsn5ft dsn5ft closed this as completed May 6, 2020
@ataulm
Copy link
Contributor Author

ataulm commented May 6, 2020

Ah yeah, we're doing it locally using materialThemeOverlay, I just simplified the example for this issue.

Thanks, I'll open it on the main bug tracker! 👍

@ataulm
Copy link
Contributor Author

ataulm commented May 7, 2020

For others following along, submitted here - https://issuetracker.google.com/issues/155939564

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