Paperize icon indicating copy to clipboard operation
Paperize copied to clipboard

Set home and lock wallpaper with same bitmap to better support parallax

Open repraze opened this issue 6 months ago • 5 comments

On stock android 14, when setting the same image for the home screen and lock screen, the parallax position of the wallpaper is kept when locking/unlocking the device. When setting 2 different images, the parallax effect only works on the home screen.

Looking at the code, I see there is 2 wallpaper services (home, lock). We do a retrieveBitmap then a processBitmap. This means setWallpaper will generate a new bitmap every time and break the parallax effect on the lock screen.

I propose to create bitmap cache (maybe a lru limited to 2 bitmaps for now) keyed on the settings (uri, darken, blur, ...) to allow for same bitmap to be returned in each service. This might help a bit with processing / memory efficiency too - although minimal.

repraze avatar Aug 19 '24 09:08 repraze