-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Resource] Drawable scaling from other density-qualified resource #4368
Comments
Thanks for this feature request! We will discuss it. |
Could you elaborate why the default |
Your question bring me to a rethought of my usage. In some of our usages, we don't specify the size of drawable or ImageView, just set it to That is what I requested in feature 1. But I am not sure if it is a good prectice in UI coding. Anyway, feature 2 will be helpful not only in this case, but also any other if more customization needed. |
I need more examples for "if more customization needed". I guess it should be covered by #4197 |
… android logic (#4969) In general, Android prefers scaling down a larger original image to scaling up a smaller original image: https://developer.android.com/guide/topics/resources/providing-resources#BestMatch Fixes #4368 ## Release Notes ### Highlights - Resources - If there is no resource with suitable density, use resource with the most suitable density, otherwise use default (similar to the Android logic)
As Android Devices Compatibility guide shows,
Which indicates that if drawable with qualifier matches current screen is not found, Android will fetch drawable with other qualifier and scale it to fit.
In our prectice, we only provide
drawable-xxhdpi
to keep the product apk small. But in the generated compose resources, it just fail if the best-match drawable not found.IMO, it would be nice to have features that:
The text was updated successfully, but these errors were encountered: