1

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!

Swati Rawat
  • 1,729
  • 1
  • 19
  • 34

1 Answers1

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);