We'll need two fragments: one for the front of the card and the other for the back. Each fragment will define the image for the card. Then, we'll need four animation files for the full card flip effect. Here are the steps to set up the project structure correctly and to create the resources needed:
- Once you have front and back images for the cards, copy them to the res/drawable folder as card_front.jpg and card_back.jpg (keep the original file extension of your images if different).
- Create an animator resource directory: res/animator. (In Android Studio, go to File | New | Android resource directory. When the New Android Resource dialog displays, choose animator in the Resource Type drop-down list.)
- Create card_flip_left_enter.xml ...