Adding a RecyclerView
Before we move into the shared element transitions there are a few changes we need to change to our app as we want to reproduce the most common use of the shared element transitions, a RecyclerView with a details screen.
By the end of this step this will be our final app:

First of all we need to change the CardViewin both of our XML layout files to a RecyclerView.
Then we need to create the XML layout for our list items.
We then create a data class for our mock data:
On our MainActivity.kt we add the following methods
We also need to create a RecyclerView Adapter.
Finally we populate our RecyclerView with our dummy data
And of course we run our app to test that everything is working
Last updated