Add transition or Cross-fade between two images.
Step 1: Create a transition drawable in XML
Save this file
res/drawable folder of your project.
The image1 and image2 are the two images that we want to transition and they should be put in your
res/drawable folder too.
Step 2: Add code for ImageView in your XML layout to display the above drawable.
Step 3: Access the XML transition drawable in onCreate() method of your Activity and start transition in onClick() event.
Animate views background color (switch-color) with TransitionDrawable
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0