5

How can I implement a custom swipe animation instead of the standard horizontal movement? I'm thinking about a mixture of ViewPager (swipe to scroll) and ViewFlipper (custom animation). It's important that the animation gives a live feedback to the user's finger movement, not just plays after a swipe has been completed.

Some examples:

Any idea on how to generally override the swipe animation in a ViewPager?

damaxxed
  • 2,464
  • 2
  • 16
  • 17

1 Answers1

2

You will have to override onTouchEvent(), onScroll() and the likes. Point is that the ViewPager's swipe is no animation but actually scrolls the views around. Animations wont work for you here is my bet.

Bondax
  • 3,143
  • 28
  • 35
  • OK, I get the idea. I'll intercept onScroll() and tilt the side views as an example. My last question: How do I implement the tilt as overscroll effect? When reaching boundaries, onScroll won't be called anymore. Like the ICS launcher does it ( http://developer.android.com/design/media/touch_feedback_communication.png ) – damaxxed Mar 26 '12 at 18:30
  • 1
    Call scrollTo(x,y) with (x,y) being out of bounds. – Bondax Mar 28 '12 at 06:01
  • 1
    suggest me for http://stackoverflow.com/questions/12274943/3d-animation-between-activity-in-android – Parag Chauhan Sep 24 '12 at 20:30