Share Image element transition display incorrect size : <p>I have a recycle view to show all photo thumbnail items. When click on item, I use transition for imageview in this item to Detail activity. The problem is that image source is gotten from internet by <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="noreferrer">UIL</a>. And <strong>sometime (not always) the images not reload correct size</strong> like this:</p>

<p><a href="https://i.stack.imgur.com/aqDV4.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/aqDV4.jpg" alt="transition error"></a> </p>

<pre><code> // on view holder item click
  final Pair&lt;View, String&gt;[] pairs = TransitionHelper.createSafeTransitionParticipants(this, false,
                    new Pair&lt;&gt;(((ItemViewHolder) viewHolder).thumbnail, getString(R.string.TransitionName_Profile_Image)),
                    new Pair&lt;&gt;(((ItemViewHolder) viewHolder).tvName, getString(R.string.TransitionName_Profile_Name)));

  ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(this, pairs);
  startActivityForResult(intent, requestCode, transitionActivityOptions.toBundle());
</code></pre>

<p><strong>Detail activity</strong></p>

<pre><code>// try to post pone transition until UIL load finish
ActivityCompat.postponeEnterTransition(this);
getSupportFragmentManager().beginTransaction().replace(R.id.layoutContent, new DetailFragment()).commit();
</code></pre>

<p><strong>Fragment Detail</strong></p>

<pre><code>ImageLoader.getInstance().displayImage(url, imageViewDetail, new ImageLoadingListener() {
                @Override
                public void onLoadingStarted(String imageUri, View view) {

                }

                @Override
                public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
                    finishAnimation();
                }

                @Override
                public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {

                    finishAnimation();
                }

                @Override
                public void onLoadingCancelled(String imageUri, View view) {
                    finishAnimation();
                }
            });


 private void finishAnimation(){
     ActivityCompat.startPostponedEnterTransition(getActivity());
     imageViewDetail.invalidate();
 }
</code></pre>

<p><strong>fragment_detail.xml</strong></p>

<pre><code> &lt;FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    &gt;

     &lt;ImageView
        android:transitionName="@string/TransitionName.Profile.Image"
        android:id="@+id/imageViewDetail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:scaleType="centerCrop"/&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p>I even wait views are laid out before load image but still not work:</p>

<pre><code>imageViewDetail.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                // code load image from UIL
                return false;
            }
        });
</code></pre>

<p>Is there any way to avoid this issue?</p>
