0

I have a strange problem (maybe it's a bug in transitions library) with shared element transition animations. Target Android version is 5.0.

Here is my layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"                                     xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/root_layout">

        <RelativeLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <!-- The main content view -->
            <FrameLayout
                android:id="@+id/content_main"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
            </FrameLayout>

            <!-- The second content view -->
            <FrameLayout
                android:id="@+id/content_second"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
            </FrameLayout>

        </RelativeLayout>
</RelativeLayout>

I have 2 fragments (FragmentA and FragmentB). FragmentA has imageViewA and FragmentB has imageViewA with bigger size. Shared element transitions defined correctly and when FragmentB opens imageViewA animated correctly.

But it works just in case when FragmentA is added to content_frame container (root container). If I'm adding FragmentA to content_main container - animation not working at all.

  • If I add to content_second container some view - animation is not working.
  • If I keep content_second container empty - animation is not working.
  • Even if I remove content_second container - animation is not working.

Both fragments would be added to the same container (using FragmentTransaction.replace).

Veaceslav Gaidarji
  • 4,261
  • 3
  • 38
  • 61
  • What version of Android are you running on? (5.0 or 5.1?) There is at least one bug regarding nested shared element views in 5.0, which is why I ask. See this SO question [here](http://stackoverflow.com/q/26495077/844882) for more info. – Alex Lockwood Mar 13 '15 at 18:21
  • 5.0.2 :( but the following link tells about bug with Activity transitions. Is it true for Fragment's also? – Veaceslav Gaidarji Mar 14 '15 at 05:22

0 Answers0