This entirely depends on what Home Screen Launcher you are using. On earlier phones, up to around the Samsung S2, the default installed Home Screen indeed provided such callbacks to the Live Wallpaper. Under those home screens, a standard static wallpaper would also scroll in response to swipes between pages. On more recent phones, the default home screens are treating the pages like a cylinder rather than a sheet, so as you scroll past the left-most page, it jumps to the right-most page. So you can keep swiping pages and end up when you started, on the original page. Under that paradigm, scrolling the wallpaper (static or otherwise) in response to swipes becomes more difficult, because there is an obvious jarring effect as you jump from the far left of the background image to the far right. The S2 did it like that, and it was noticeably weird. So modern phones homescreens have changed to simply not provide the onOffsetChanged callbacks at all to live wallpapers, and a static wallpaper doesnt respond to page swipes also. I guess that is what is happening on your device, I assume the a static background wallpaper isnt scrolling in response to swipes? If you try another Home Screen such as Go Launcher, you will see the callbacks working, as they havent implemented the cylinder page paradigm. But that doesnt solve your problem, because basically as it stands you can't guarantree that a particular user has a homescreen that supports onOffsetChanged, so you will need to find another UI method to change the wallpaper. How about shaking? That is independent of the home screen and the vast majority of phones these days have motion detection, but is not so useful for tablets.
On Tuesday, October 29, 2013 7:31:37 AM UTC+8, Matt Schoen wrote: > Hi there, > > I'm making a live wallpaper that I would like to change when the user > swipes the screen. I have a TouchListener set up, but I have had trouble > precisely matching the behavior of the home screen. In other words, > sometimes when I swipe the screen, the home screen will change pages but my > app wallpaper will not, and if I make it more "sensitive", it will flip > sometimes when the home screen doesn't. > > The > WallpaperService.Engine.onOffsetsChanged<http://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html#onOffsetsChanged(float,+float,+float,+float,+int,+int)>method > seems to be what I'm looking for, but I only see it called when the > app starts and when you return home from an app. It is not called as I > swipe or change home screen pages. This StackOverflow > article<http://stackoverflow.com/questions/6637753/using-onoffsetschanged-to-get-home-screen-swipe-direction>leads > me to believe that I should get callbacks on this function every time > the home screen moves. > > Any ideas? > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.