JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

[resources] Update resource density-based lookup to be equal with the android logic #4969

Closed terrakok closed 6 days ago

terrakok commented 1 week ago

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 https://github.com/JetBrains/compose-multiplatform/issues/4368

Release Notes

Highlights - Resources

igordmn commented 1 week ago

Update resource filtering and add density-based lookup to be equal with the android logic

Better to be more specific. Something like:

If there is no resource with suitable density, use resource with the most suitable density, otherwise use default (similar to the Android logic)