Android shared element to dialog actvitiy
<p>I've got one activity with an image in a toolbar and an activity that is themed like a dialog with the same image in big. These are the layout files:</p>

<p>my_activity.xml:</p>

<pre><code>...

&lt;com.makeramen.roundedimageview.RoundedImageView
    android:id="@+id/my_image"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:scaleType="centerCrop"
    android:src="@drawable/my_drawable"
    android:transitionName="@string/my_image_transition"
    app:riv_oval="true" /&gt;

...
</code></pre>

<p>my_dialog_activity.xml:</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"&gt;

    &lt;ImageView
        android:id="@id/my_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/my_drawable"
        android:tint="@color/accent"
        android:transitionName="@string/my_image_transition" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>The dialog activity becomes a dialog by applying this theme in the manifest:</p>

<pre><code>&lt;style name="MyDialogActivity" parent="Theme.AppCompat.Light.Dialog.MinWidth"&gt;
    &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
    &lt;item name="android:windowMinWidthMajor"&gt;@dimen/abc_dialog_min_width_major&lt;/item&gt;
    &lt;item name="android:windowMinWidthMinor"&gt;@dimen/abc_dialog_min_width_minor&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>Both the activity and the dialog look exactly how I want them to look like.</p>

<p>Now I want to implement a shared element animation with these ImageViews: When the user clicks on the first activity's image, it has to grow and move into the middle of the screen so it fits the bigger dialog's image.</p>

<p>So I wrote this code:</p>

<pre><code>Intent intent = new Intent(MyActivity.this, MyDialogActivity.class);

if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
        MyActivity.this, v, getString(R.string.my_image_transition)
    );
    startActivityForResult(intent, 999, options.toBundle());
} else {
    startActivityForResult(intent, 999);
}
</code></pre>

<p>The animation does actually happen, but the moved image is only visible inside of the dialog's area. So you see an image that comes from the dialog's upper left corner, but you don't see it moving from the first activity outside of the dialog.</p>

<p>Here's a HTML version of how it should look like and what it currently looks like: <a href="https://jsfiddle.net/wutqdh9d/1/" rel="nofollow">https://jsfiddle.net/wutqdh9d/1/</a></p>