Do Shared Elements support dynamic, programmatic resizing before the transition?


I have a shared element transition between two fragments (ImageView → ImageView).

If both ImageViews have fixed sizes in XML, the transition works perfectly.

But if I set the size of the first ImageView programmatically using setLayoutParams() before starting the transition — even if the final size matches the XML — the shared element transition stops working and falls back to a regular fade/scale animation.

So my question is:

Do Shared Elements support dynamic, programmatic resizing before the transition, or is this mechanism limited to fixed‑size views only? Has anyone made this work in practice?

1
Feb 20 at 8:13 AM
User AvatarStyle-7
#android#android-fragments#shared-element-transition

No answer found for this question yet.