Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom swipe animation (Tilt, Card Deck, 3D, etc.)

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:

  • http://www.youtube.com/watch?feature=player_embedded&v=BcloiEZa1iI
  • ICS launcher tilt effect
  • Card deck effect in ICS launcher menu
  • Cube effect of custom launchers

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

like image 884
damaxxed Avatar asked Nov 04 '22 03:11

damaxxed


1 Answers

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.

like image 95
Bondax Avatar answered Nov 09 '22 07:11

Bondax