Android Question How to use a scrolling livewallpaper in an app

NeoTechni

Well-Known Member
Licensed User
Longtime User
I currently use a hack, where the style of the activity is set to transparent and I send the virtualWidth and X via an intent to my own wallpaper. But the scrolling isn't smooth, and doesn't work well when the user lifts their finger up (it switches back to the framerate the LWP uses)

Is there a way to do it the same way real launchers do it, that would allow scrolling in every live wallpaper instead of just the one I made?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Where/how would I do that? Is that code for the LWP or for the launcher?

EDIT: Ah, that'd go int he launcher, and it has these parameters:

setWallpaperOffsetSteps (float xStep, float yStep)
becomes: LWP.RunMethod("setWallpaperOffsetSteps", Array As Float(1/(NumberOfPages-1), 0))

yStep will always be zero since almost nothing does vertical scrolling
xStep is 1/(numberofscreens-1)

That'd handle the snapping, but how do I send the virtualWidth and X?

Ah, these:

public void suggestDesiredDimensions (int minimumWidth, int minimumHeight)
becomes: LWP.RunMethod("suggestDesiredDimensions", Array As Int(CurrentWidth, ScaleHeight))

public void setWallpaperOffsets (IBinder windowToken, float xOffset, float yOffset)


Also, no idea how to call the last one (the windowToken)
 
Last edited:
Upvote 0
Top