How can I make my page slide as the user slides finger on the screen?

Muhammad Maqsoodur Rehman picture Muhammad Maqsoodur Rehman · Apr 23, 2010 · Viewed 80.8k times · Source

How can I make my page slide as the user slides finger on the screen? Any example code?

I just require the same feel as it is on my android g-phone's home screen. The screen moves as the finger moves (also includes the elastic effect).

Answer

Steve Haley picture Steve Haley · Apr 23, 2010

Check out this tutorial and its follow up on warriorpoint. They explain how to use the ViewFlipper to smoothly animate the transition from one screen to another, and then in the second part how to do this using touch control. Note, these are whole-screen transitions not panning around on an existing page. For panning, e.g. on an oversized image that doesn't fit in the screen, check out Android BigImage. Depending on what you're trying to do these might be overkill, but it's not 100% clear what you're trying to achieve.