You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good afternoon, in our application user can set a wallpaper from the gallery, take a photo or choose from the available ones. When selecting from the gallery, the image is copied to the application folder (getFilesDir/dir) and later will be used to display after logging into the account, this approach has a disadvantage - if the user sets an image of large size (4000x6000) and weighing several megabytes, the image will be displayed after a second, which is very long.
I tried to preload the image, but I encountered that due to specifying ContentScale.Crop in AsyncImage, the image keeps loading after a second instead of immediately from memory and after displaying with ContentScale.Crop type, the memory cache increases.
If you use AsyncImage with ContentScale by default, the image will be shown instantly from memory and memory cache will not increase.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good afternoon, in our application user can set a wallpaper from the gallery, take a photo or choose from the available ones. When selecting from the gallery, the image is copied to the application folder (getFilesDir/dir) and later will be used to display after logging into the account, this approach has a disadvantage - if the user sets an image of large size (4000x6000) and weighing several megabytes, the image will be displayed after a second, which is very long.
I tried to preload the image, but I encountered that due to specifying ContentScale.Crop in AsyncImage, the image keeps loading after a second instead of immediately from memory and after displaying with ContentScale.Crop type, the memory cache increases.
If you use AsyncImage with ContentScale by default, the image will be shown instantly from memory and memory cache will not increase.
How can the problem be solved?
Beta Was this translation helpful? Give feedback.
All reactions