Read complete story

How to make sharedElement Transition

In this blog, We are going to show you how to shared element Image transition works in application.

To make a screen transition animation between two activities that have a shared element:

  1. Enable window content transitions in your theme.
  2. Specify a shared elements transition in your style.
  3. Define your transition as an XML resource.
  4. Assign a common name to the shared elements in both layouts with the android:transitionName attribute.
  5. Use the ActivityOptions.makeSceneTransitionAnimation() method.

Implementation

Step 1: Add android:transitionName=”profile” in your ImageView

activity_main.java

Step 2:  Add below code on your onClickListener,

 

MainActivity.java

 

Step 3: Add android:transitionName=”profile” in your ImageView in Result Activity,

 

Done, Now you have made your first shared element transition.

 

 

 

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close