
Android Application Development Cookbook
By :

The previous recipe, Creating a Card Flip Animation with Fragments, demonstrated a transition animation using animation resource files. In this recipe, we will create a zoom effect using animation resources created in code. The application shows a thumbnail image then expands to an enlarged image when pressed.
The following image contains three screenshots showing the zoom animation in action:
Create a new project in Android Studio and call it: <project name>
. Use the default Phone & Tablet options and select Empty Activity when prompted for the Activity Type.
For the image needed for this recipe, we downloaded a picture from www.Pixabay.com to include in the project source files, but you can use any image.
Once you have your image ready as stated previously, follow these steps:
res/drawable
folder and name it image.jpg
(if not a jpeg image, keep the original file extension).Change the font size
Change margin width
Change background colour