Skip to content Skip to sidebar Skip to footer

Glitch When Animating Nested Views In A Shared Element Activity Transition?

I've been messing around with the new APIs in Android 5.0 and have been trying to figure out whether or not it is possible to animate both a ViewGroup and one of its children separ

Solution 1:

Yes, you can transition a group and its contents separately. But you just found a bug that will be fixed in L MR1.

It appears that this is not well supported in L. I recommend that you make the shared elements siblings in the second Activity:

<FrameLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><Viewandroid:layout_width="match_parent"android:layout_height="match_parent"android:background="@color/dark_gray"android:transitionName="outer_box"/><RelativeLayoutandroid:id="@+id/outer_box"android:layout_width="match_parent"android:layout_height="match_parent"><Viewandroid:id="@+id/inner_box"android:layout_width="100dp"android:layout_height="100dp"android:layout_marginLeft="50dp"android:layout_marginTop="50dp"android:background="@color/red"android:transitionName="inner_box" /></RelativeLayout></FrameLayout>

Post a Comment for "Glitch When Animating Nested Views In A Shared Element Activity Transition?"