Rox
Rox

Reputation: 2917

How make views move along the finger motion in Android?

How can I make a nice view slider (that is following the motion of the finger, not just the touch) using a viewflipper for an Android 2.1 device?

I am using the OnTouchEvent method that is defined in the OnToushListener class to register touches. But how can I get the views move in a nice manner when dragging them to left/right?

I am using the Animator class but I find it really hard, can someone give me an example? Thanks!

Upvotes: 1

Views: 1351

Answers (1)

Savvas Dalkitsis
Savvas Dalkitsis

Reputation: 11592

You might want to take a look at ViewPager by Google. It's part of honeycomb and newer but ALSO available for 1.6 devices and up with the compatibility package:

http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

Upvotes: 2

Related Questions