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

[Internal] Add constant state support to ScaledDrawableWrapper #3572

Conversation

pubiqq
Copy link
Contributor

@pubiqq pubiqq commented Sep 14, 2023

On API < 23, the DrawableUtils.compositeTwoLayeredDrawable method can return a LayerDrawable with a child ScaledDrawable. Calling mutate() on such a LayerDrawable throws NPE because the ScaledDrawable doesn't support constant state (was fixed only in API 24, commit).

This PR adds constant state support to ScaledDrawableWrapper, thus preventing NPE on older devices.

Fixes #4129.

@pubiqq pubiqq mentioned this pull request Oct 2, 2023
@leticiarossi
Copy link
Contributor

Thank you for the PR! It's being synced in internally and will be synced out here soon, apologies for the delay

@dsn5ft dsn5ft closed this in 9da9993 May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MaterialSwitch] Crash occurs when calling setThumbTintMode on a switch with a thumb icon
2 participants