[Motion] Can't use both Container transition and Shared element
See original GitHub issueDescription: I’m trying to implement transition #1, which is from the new material motion system.
If I use sharedElementEnterTransition = MaterialContainerTransform()
then I get a really nice looking container transform, BUT my issue is that my container has an image and I’d like to share that image. There doesn’t seem to be clear guidance on how to do this, so I tried my best with just getting the container (outer viewgroup) and the contained imageView, and it doesn’t seem to work. I can verify that my shared element is working, because if I remove my container transition and just put the transition on the image view via TransitionInflater.from(context).inflateTransition(android.R.transition.move)
then I get a nice animated shared element. My issue is that I want both.
Looking at the gif from the material team below, it does seem like they include a package deal of a container transition + a shared element imageview.
https://miro.medium.com/max/1400/1*0vL7z6wwb1X9tvR6_rdQLw.gif
Expected behavior: As far as I can understand, MaterialContainerTransform() should allow you to chain another shared element.
Issue Analytics
- State:
- Created 3 years ago
- Comments:26 (11 by maintainers)
Top GitHub Comments
Have spent ages trying to figure out why my container transform wasn’t scaling and this was the issue! Thanks for this.
Thanks @ColtonIdle! Let’s file separate issues for anything specific that is happening.