addSharedElement not work when using `add`
See original GitHub issue Fragment fragment = ViewerFragment.newInstance(diary.getPhotoUrl());
fragment.setSharedElementEnterTransition(new ChangeBounds());
getFragmentManager().beginTransaction()
.hide(this)//either using hide or not won't work
.add(R.id.container, fragment)// it work when using replace
.addToBackStack("")
.addSharedElement(attachPicture, attachPicture.getTransitionName())
.commit();
Could you tell me why is that? Because I read the document of addSharedElement
, it says:
Used with custom Transitions to map a View from a removed or hidden Fragment to a View from a shown or added Fragment.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Fragment shared element transition with add() instead of ...
Try this getSupportFragmentManager().beginTransaction() .addSharedElement(myImage, "mytransition") .add(R.id.recycler_view_container, ...
Read more >Hidden mistakes with Shared Element Transitions - Medium
Call addSharedElement() and add the views that will be shared between screens. Add unique android:transitionName on each view in transition.
Read more >Android shared element transition not working - Issue Tracker
No back stack working in java code. Shared element transition is showing type Error Required type: androidx.navigation.Navigator.Extras
Read more >Shared Element Activity Transition | CodePath Android Cliffnotes
Assign a common transition name to the shared elements in both layouts. Use the android:transitionName attribute. ... Note that it doesn't matter if...
Read more >FragmentTransaction - Android Developers
When running on Android 3.0 or above, this implementation is still used; it does not ... Add a fragment to the associated FragmentManager...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t get you. When I use
replace
it works. The view is always referencing in the old one. I think it’s a bug. Now I use Activity with sharedElement and works well. I think the document is clear enough, so… Don’t you think?I have exact issues even with androidX. I have open a bug on issuetracker on google. Anyone have found a workaround?