4

At the moment I have my live wallpaper which takes an image chosen by the user, from their SD card and sets it as the background. Its coming along nicely, however I notice that many live wallpapers change the view of the background when the user slides to switch their homescreens from right to left.

For example, the middle homescreen displays the middle part of the image, when the user slides their finger to the right to get to their next homescreen on the left, the background image moves with it showing part of the image further to the left.

I've trying searching how to do this, but to no avail, does anyone have any info on what's used to recreate this image sliding animation?

Thanks,

William Stewart.

peterh
  • 11,875
  • 18
  • 85
  • 108
William Stewart
  • 841
  • 1
  • 14
  • 27

1 Answers1

6

If you want your wallpaper to scroll, you will need to monitor onOffsetsChanged() events.

Take a look at this answer: android live wallpaper rescaling
Let me know if you have any further questions.

Community
  • 1
  • 1
George Freeman
  • 2,260
  • 1
  • 15
  • 22
  • Perfect. I started reading about offsets just before you answered, but you helped push me in the right direction. I found this website extremely helpful: http://www.android10.org/index.php/articlesuserinterface/256-live-wallpaper-example Thanks for your help. – William Stewart May 28 '11 at 03:20
  • 1
    Pleased to be of assistance. Thank you for accepting my answer. Welcome to the community. The tutorial you provide is pretty good, though it appears to have been "scraped" from another source: http://www.pushing-pixels.org/2010/02/01/live-wallpapers-with-android-sdk-2-1.html The original post has links to the source on GitHub near the bottom – George Freeman May 28 '11 at 12:28