4

How I can clicking on an image of a row of a RecyclerView, display an image in the center of the screen with an animation like Whatsapp?

Thank you

enter image description here

IMS
  • 265
  • 4
  • 17

1 Answers1

1

What you are looking for is called shared element transition.

In your RecycleAdapter add these line . android:transitionName="TRANSITION_NAME"

<ImageView
    android:transitionName="TRANSITION_NAME"
    android:layout_width="@dimen/content_width"
    android:layout_height="@dimen/content_height" />

Also , in the next page's ImageViewalso add the same line

Zahidul Islam
  • 3,180
  • 1
  • 25
  • 35
  • And to display the image in the same activity? I want to show the image on the recyclerview – IMS Apr 28 '16 at 10:12
  • As far as i understand there are 2 activity here . One is normal `Activity` and another is `AlertDialouge` as an activity (top on the Recycleview). Or, If you want to do it in a activity then you have to write custom animation to show that way . – Zahidul Islam Apr 28 '16 at 10:15