I have pushed my sample app here: https://bitbucket.org/user1010/transitiondemo
I am following master-detail pattern in my app. Master fragment (MyRecyclerFragment
/ MyListFragment
) shows a list of textviews. When user clicks on any of those textviews, details fragment (MyDetailsFragment
) is launched. Details fragment has the title (same as the one on which user had clicked).
I am trying to achieve the following transition effect:
- Explode transition for exiting views
- Fade transition for appearing views
- Move / Translation transition for the TextView which is shared between those 2 fragments
Issues:
- The shared TextView disappears when the transition starts. But the shared transition miraculously works if the first item of the list is clicked.
- Transition works if details layout is changed. Please see
details.xml
. If I remove FrameLayouttitle_bar
completely and put TextViewtitle
as a direct child of root LinearLayout, shared element transition works perfectly. - It seems like epicentre gets changed for shared element return transition. For example, if I click on 7th TextView in the list, exit transition (explode) takes that TextView as epicentre. All the TextViews above it slide up and the TextViews below it slide down. But while returning from details fragment to master fragment, epicentre for the return transition is not the TextView which was clicked.
try with this -
set the each row image with different-different transition name -
then on item click for example -
In EndFragment in oncreate method get the key of transition name and set on the view -
related https://stackoverflow.com/a/31982516/3150663
Vote my answer up if you got solution. :)