O'Reilly logo

Android Studio Cookbook by Mike van Drongelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Great transitions

If you click on any of the cards it will display the entry view again with the comments and a preview of the picture that we took previously.

We do not just want to move from the list view to the detail view. Material design also takes care of great natural transitions. This recipe is going to apply just that.

Getting ready

To go through this recipe, you will need to have the previous recipes up and running. This recipe is going to add some animations to it.

How to do it…

The following steps will help us to add the animations to our app:

  1. Add a mDrink member to ViewHolder in the MainAdapter class:
    public Drink mDrink;
  2. In the same file in the onBindViewHolder method inform the view holder about the actual drink, just after the initialization ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required