I am trying to make a live wallpaper. I understand that onOffsetsChanged method is used to get the current position of the screen. I am not able to properly understand how to implement this method to get the livewallpaper or just even a standard wallpaper to move sideways along with the user swipes. I tries looking through some examples but still i am not clear. Can someone give me an idea and suggest some good tutorial for a live wallpaper that can move across the screen with user swipes. Thanks in advance!
Asked
Active
Viewed 1,368 times
1
-
see this post maybe helpful http://stackoverflow.com/questions/6637753/using-onoffsetschanged-to-get-home-screen-swipe-direction – ρяσѕρєя K Oct 06 '12 at 08:42
-
Got a reply here http://stackoverflow.com/questions/10816432 – Swati Rawat Oct 06 '12 at 09:23
1 Answers
1
you need to make
public float mmPixel;
and then
public void onOffsetsChanged(float xOffset, float yOffset, float xStep,
float yStep, int xPixels, int yPixels) {
mmPixel = xPixels;
}
and draw your Bitmap like this on Canvas c
c.drawBitmap(Bitmap bitmap, mmPixel, 0, null);

user3645487
- 11
- 3