Saad Farooq
Saad Farooq

Reputation: 13402

Android cards animation

What's would be the best strategy for making a stack of cards in Android that animate cyclically i.e. card on top when swiped goes to the bottom.

The approach I was going for is making the cards as layout files (with details filled in code) and then using the ListView type mechanism to make the views move in the desired way. However, I don't see a good way of taking care of the z-ordering in this approach.

Any ideas or links to libraries that do similar stuff is appreciated.

Upvotes: 2

Views: 1370

Answers (2)

bostan
bostan

Reputation: 375

You can use a viewpager and then set pager transformation. You can customize the pagertransformation according to your need. ViewPager can be made cyclic. To start off you can check the developer site, they have the basic implementation of pagertransformer with viewpager.

Upvotes: 3

dilix
dilix

Reputation: 3893

I think it will be more natural to create such animation not programatically but as a small movie. You can calculate what card is under the picture dynamically but shuffle it with hardcoded movie.

Upvotes: 0

Related Questions