Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I programmatically set a wallpaper to not scroll?

Tags:

android

I am writing an app that allows a user to set the phone's wallpaper from a list of pictures. By default it scrolls across the multiple home screens. I want the wallpaper on the home screen to be a static non-scrolling image.

What can I do programmatically to achieve this? Is this even possible?

I am using wallpaperManager.setResource(...); to set the wallpaper.

I've also tried wallpaperManager.setWallpaperOffsetSteps(0,0); but that did not solve my problem.

like image 428
bims Avatar asked Dec 12 '22 19:12

bims


1 Answers

I'v fulfilled this feature by:

final WallpaperManager wpm = (WallpaperManager)getSystemService(
                Context.WALLPAPER_SERVICE);    
wpm.setWallpaperOffsetSteps(1, 1);
wpm.suggestDesiredDimensions(SCREEN_WIDTH, SCREEN_HEIGHT);
like image 133
herbertD Avatar answered Jan 27 '23 01:01

herbertD