Niagara-Issues
Niagara-Issues copied to clipboard
Wrong icon for Niagara Settings when scrolling fast after cache clear
Describe the bug
When the phone cache is cleared, manually or over night or after a reboot and you scroll down quickly the icon for the niegara settings is displaying a random app icon for a few seconds.
While this fixes itself within seconds and doesn't impact use ability, it's been bugging me forever, so I finally decided to file a report.
Steps to reproduce
- Clear your phone cache
- Scroll down the app list quickly
Device name
Xiaomi Mi 10 Lite
Android version
Android 12
Screenshots / Screen recordings
Here for example it took the icon of my recorder app:
Weird, I cannot reproduce this on my end. The icons aren't stored in the cache anyways, they are only loaded from the app resources into the RAM. Are you using some sort of theme engine by any chance?
Nope, I'm not using any theme engine. Only a custom icon pack - whicons.
From my dabbling with Android it seems like a bug or incorrect use of a RecyclerView.
Interestingly only the niagara settings are affected, not the regular App Icons.
My guess would be that the app icons are somewhat preloaded and can immediately be accessed by the viewholder in the RecyclerView, but the niagara settings icon is not. So when it has to be shown for the first time, the RecyclerView reuses an element from before and it shows the old app icon, until the settings icon is loaded.
We do load the icon asynchronously as a performance optimization, so that may indeed be the reason. But I'm surprised it only happens on the settings icon though, since that should actually be less expensive to load than the app icons. And even then it's a fraction of a second, not "a few seconds". I need to investigate this further.
Also happens for the new "Recently installed" item. It didn't happen with the "Niagara settings" item, but that might have been a fluke.
Merged with https://github.com/8bitPit/Niagara-Issues/issues/2033