manager: fix crashes when loading ultra-high resolution app icons#3227
Merged
YuKongA merged 3 commits intotiann:mainfrom Feb 28, 2026
Merged
manager: fix crashes when loading ultra-high resolution app icons#3227YuKongA merged 3 commits intotiann:mainfrom
YuKongA merged 3 commits intotiann:mainfrom
Conversation
Contributor
Author
|
fix #3226 |
Collaborator
|
或许可以使用coil和appiconloader |
Contributor
Author
|
改了一下,利用采用率缩放bitmap,现在那个2500x2500的图标(不知道为什么,在我的foldable avd上面原始bitmap分辨率单边能到6k+)平均40ms加载 |
- Refactor `AppIconImage` to use `ApplicationInfo` and support asynchronous icon loading with a crossfade transition. - Implement icon scaling for oversized bitmaps to improve performance and memory usage. - Add a placeholder while the icon is loading. - Introduce `DrawablePainter` to handle native `Drawable` rendering within Compose. - Update `AppIconImage` to handle cases where `applicationInfo` might be null. Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
- Use `BitmapFactory.Options` with `inSampleSize` to decode oversized icons more efficiently. - Replace `pm.getApplicationIcon` with `loadUnbadgedIcon` and manually apply user badges using `getUserBadgedIcon` to support multi-user profiles. - Improve icon scaling logic by using `Canvas` to draw into a fixed-size bitmap when icons exceed twice the target size. - Add `calculateInSampleSize` helper for memory-efficient image downsampling. Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Collaborator
|
现在哪个性能好点 |
…ROMs optimize loadUnbadgedIcon, such as adding clipping or automatic scaling, these optimizations are acceptable when the icon is not particularly large. - Increase the icon size threshold for downsampling from 2x to 6x. - Ensure `finalDrawable` is explicitly nulled when the icon size is within bounds or an exception occurs during decoding. Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Contributor
Author
大部分情况差不多,但是在一些定制rom上会优化 loadUnbadgedIcon 会添加clip,自动缩放之类的,如果遇上超大图的时候decodeResource更快,appiconloader 会读优化后的图标就会慢一些 AppIconImage coil |
YuKongA
approved these changes
Feb 27, 2026
u9521
added a commit
to u9521/KernelSU
that referenced
this pull request
Feb 28, 2026
…ann#3227) - Automatically scales down oversized bitmaps based on the target display size before rendering. - Added a crossfade animation for smoother icon loading and implemented async label loading. --------- Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
u9521
added a commit
to u9521/KernelSU
that referenced
this pull request
Feb 28, 2026
…ann#3227) - Automatically scales down oversized bitmaps based on the target display size before rendering. - Added a crossfade animation for smoother icon loading and implemented async label loading. --------- Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.