How to make sharedElement Transition

Save

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.

 

 

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

We've bought a Shopware Extension which is a hybrid App, which we can now offer in the Google Play Store and the IOS App Store. I'am still impressed how fast and how sharp the support team leads us through every process of the App-Store clarification. Very fast and useful response.

Markus Walter

Markus Walter

Founder, Das Apartment Living

Talk to Sales

Global

Live Chat
Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home