<p dir="auto"><strong>Glide Version : 4.0.0</strong>:</p>

<p dir="auto"><strong>Integration libraries : okhttp3-integration:4.0.0</strong>:</p>

<p dir="auto"><strong>Device/Android Version : xiaomi 6.0</strong>:</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:<br>
options add transform , when refresh recyclerview , the item image will flicker .</p>

<p dir="auto"><strong>Glide load line / <code class="notranslate">GlideModule</code> (if any) / list Adapter code (if any)</strong>:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" RequestOptions options = new RequestOptions();
        options.placeholder(R.drawable.default_news_cat_pic)
                .error(R.drawable.default_news_cat_pic)
                .dontAnimate()
                .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                .options.transform(new TopCrop(imageView.getContext()));

GlideApp.with(image.getContext())
      .load(url)
      .apply(options)
      .into(image);"><pre class="notranslate"> <span class="pl-smi">RequestOptions</span> <span class="pl-s1">options</span> = <span class="pl-k">new</span> <span class="pl-smi">RequestOptions</span>();
        <span class="pl-s1">options</span>.<span class="pl-en">placeholder</span>(<span class="pl-smi">R</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">default_news_cat_pic</span>)
                .<span class="pl-en">error</span>(<span class="pl-smi">R</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">default_news_cat_pic</span>)
                .<span class="pl-en">dontAnimate</span>()
                .<span class="pl-en">diskCacheStrategy</span>(<span class="pl-smi">DiskCacheStrategy</span>.<span class="pl-c1">AUTOMATIC</span>)
                .<span class="pl-s1">options</span>.<span class="pl-en">transform</span>(<span class="pl-k">new</span> <span class="pl-smi">TopCrop</span>(<span class="pl-s1">imageView</span>.<span class="pl-en">getContext</span>()));

<span class="pl-smi">GlideApp</span>.<span class="pl-en">with</span>(<span class="pl-s1">image</span>.<span class="pl-en">getContext</span>())
      .<span class="pl-en">load</span>(<span class="pl-s1">url</span>)
      .<span class="pl-en">apply</span>(<span class="pl-s1">options</span>)
      .<span class="pl-en">into</span>(<span class="pl-s1">image</span>);</pre></div>

<p dir="auto"><strong>Layout XML</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
        &lt;RelativeLayout
            android:id=&quot;@+id/rl_content&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:paddingLeft=&quot;@dimen/normal_margin&quot;
            android:paddingRight=&quot;@dimen/normal_margin&quot;
            android:paddingTop=&quot;@dimen/normal_margin&quot;&gt;

            &lt;TextView
                android:id=&quot;@+id/tv_title&quot;
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;wrap_content&quot;
                android:layout_alignLeft=&quot;@+id/ll_head&quot;
                android:layout_alignStart=&quot;@+id/ll_head&quot;
                android:layout_below=&quot;@id/ll_head&quot;
                android:ellipsize=&quot;end&quot;
                android:lineSpacingExtra=&quot;3dp&quot;
                android:maxLines=&quot;2&quot;
                android:paddingBottom=&quot;2dp&quot;
                android:text=&quot;标题&quot;
                android:textColor=&quot;@color/text_black&quot;
                android:textSize=&quot;@dimen/font_size_big&quot; /&gt;

            &lt;ImageView
                android:id=&quot;@+id/iv_image&quot;
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;187dp&quot;
                android:layout_below=&quot;@id/tv_title&quot;
                android:layout_marginTop=&quot;5dp&quot;
                android:src=&quot;@drawable/default_news_cat_pic&quot; /&gt;

            &lt;TextView
                android:id=&quot;@+id/tv_desc&quot;
                style=&quot;@style/noraml_text_style&quot;
                android:layout_below=&quot;@id/iv_image&quot;
                android:layout_marginTop=&quot;7dp&quot;
                android:ellipsize=&quot;end&quot;
                android:lineSpacingExtra=&quot;2dp&quot;
                android:maxLines=&quot;2&quot;
                android:text=&quot;简介&quot;
                android:visibility=&quot;gone&quot; /&gt;

        &lt;/RelativeLayout&gt;

"><pre class="notranslate"><code class="notranslate">
        &lt;RelativeLayout
            android:id="@+id/rl_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="@dimen/normal_margin"
            android:paddingRight="@dimen/normal_margin"
            android:paddingTop="@dimen/normal_margin"&gt;

            &lt;TextView
                android:id="@+id/tv_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/ll_head"
                android:layout_alignStart="@+id/ll_head"
                android:layout_below="@id/ll_head"
                android:ellipsize="end"
                android:lineSpacingExtra="3dp"
                android:maxLines="2"
                android:paddingBottom="2dp"
                android:text="标题"
                android:textColor="@color/text_black"
                android:textSize="@dimen/font_size_big" /&gt;

            &lt;ImageView
                android:id="@+id/iv_image"
                android:layout_width="match_parent"
                android:layout_height="187dp"
                android:layout_below="@id/tv_title"
                android:layout_marginTop="5dp"
                android:src="@drawable/default_news_cat_pic" /&gt;

            &lt;TextView
                android:id="@+id/tv_desc"
                style="@style/noraml_text_style"
                android:layout_below="@id/iv_image"
                android:layout_marginTop="7dp"
                android:ellipsize="end"
                android:lineSpacingExtra="2dp"
                android:maxLines="2"
                android:text="简介"
                android:visibility="gone" /&gt;

        &lt;/RelativeLayout&gt;


</code></pre></div>

<p dir="auto"><strong>Stack trace / LogCat</strong>:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="paste stack trace and/or log here"><pre class="notranslate"><span class="pl-en">paste</span> <span class="pl-en">stack</span> <span class="pl-en">trace</span> <span class="pl-k">and</span>/<span class="pl-en">or</span> <span class="pl-en">log</span> <span class="pl-en">here</span></pre></div>
<p dir="auto">Hi,</p>
<p dir="auto">first of all thank you for a great library. The issue started today when I updated to the newest Glide 4.0.0 from 4.0.0 RC1. Images everywhere started flickering when refreshing data (for example in the RecyclerView's notifyDatasetChanged method). Here is my helper class that I'm using for displaying images.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class ImageManager {
    public static ImageManager.Builder with(Context context) {
        return new Builder(context);
    }

    public static class Builder {
        private final RequestManager requestManager;
        private RequestBuilder&lt;Drawable&gt; requestBuilder;

        public Builder(Context context) {
            requestManager = Glide.with(context);
        }

        public Builder load(String url) {
            requestBuilder = requestManager.load(url);
            return this;
        }

        public Builder load(Uri uri) {
            requestBuilder = requestManager.load(uri);
            return this;
        }

        public void clear(ImageView imageView) {
            requestManager.clear(imageView);
        }

        public void into(ImageView imageView) {
            RequestOptions requestOptions = new RequestOptions();
            requestOptions = requestOptions.downsample(DownsampleStrategy.AT_LEAST);
            if (ViewCompat.getTransitionName(imageView) != null) {
                requestOptions = requestOptions.dontTransform();
            }
            requestBuilder.apply(requestOptions).thumbnail(0.1f).into(imageView);
        }
    }
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ImageManager</span> {
    <span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">ImageManager</span>.<span class="pl-smi">Builder</span> <span class="pl-en">with</span>(<span class="pl-smi">Context</span> <span class="pl-s1">context</span>) {
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">Builder</span>(<span class="pl-s1">context</span>);
    }

    <span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">class</span> <span class="pl-smi">Builder</span> {
        <span class="pl-k">private</span> <span class="pl-k">final</span> <span class="pl-smi">RequestManager</span> <span class="pl-s1">requestManager</span>;
        <span class="pl-k">private</span> <span class="pl-smi">RequestBuilder</span>&lt;<span class="pl-smi">Drawable</span>&gt; <span class="pl-s1">requestBuilder</span>;

        <span class="pl-k">public</span> <span class="pl-smi">Builder</span>(<span class="pl-smi">Context</span> <span class="pl-s1">context</span>) {
            <span class="pl-s1">requestManager</span> = <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-s1">context</span>);
        }

        <span class="pl-k">public</span> <span class="pl-smi">Builder</span> <span class="pl-en">load</span>(<span class="pl-smi">String</span> <span class="pl-s1">url</span>) {
            <span class="pl-s1">requestBuilder</span> = <span class="pl-s1">requestManager</span>.<span class="pl-en">load</span>(<span class="pl-s1">url</span>);
            <span class="pl-k">return</span> <span class="pl-smi">this</span>;
        }

        <span class="pl-k">public</span> <span class="pl-smi">Builder</span> <span class="pl-en">load</span>(<span class="pl-smi">Uri</span> <span class="pl-s1">uri</span>) {
            <span class="pl-s1">requestBuilder</span> = <span class="pl-s1">requestManager</span>.<span class="pl-en">load</span>(<span class="pl-s1">uri</span>);
            <span class="pl-k">return</span> <span class="pl-smi">this</span>;
        }

        <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">clear</span>(<span class="pl-smi">ImageView</span> <span class="pl-s1">imageView</span>) {
            <span class="pl-s1">requestManager</span>.<span class="pl-en">clear</span>(<span class="pl-s1">imageView</span>);
        }

        <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">into</span>(<span class="pl-smi">ImageView</span> <span class="pl-s1">imageView</span>) {
            <span class="pl-smi">RequestOptions</span> <span class="pl-s1">requestOptions</span> = <span class="pl-k">new</span> <span class="pl-smi">RequestOptions</span>();
            <span class="pl-s1">requestOptions</span> = <span class="pl-s1">requestOptions</span>.<span class="pl-en">downsample</span>(<span class="pl-smi">DownsampleStrategy</span>.<span class="pl-c1">AT_LEAST</span>);
            <span class="pl-k">if</span> (<span class="pl-smi">ViewCompat</span>.<span class="pl-en">getTransitionName</span>(<span class="pl-s1">imageView</span>) != <span class="pl-c1">null</span>) {
                <span class="pl-s1">requestOptions</span> = <span class="pl-s1">requestOptions</span>.<span class="pl-en">dontTransform</span>();
            }
            <span class="pl-s1">requestBuilder</span>.<span class="pl-en">apply</span>(<span class="pl-s1">requestOptions</span>).<span class="pl-en">thumbnail</span>(<span class="pl-c1">0.1f</span>).<span class="pl-en">into</span>(<span class="pl-s1">imageView</span>);
        }
    }
}</pre></div>
<p dir="auto">Maybe this issue is related with this other <a href="https://github.com/bumptech/glide/issues/2035" data-hovercard-type="issue" data-hovercard-url="/bumptech/glide/issues/2035/hovercard">issue</a>, but I didn't have a problem with this on that version so I created a new topic.</p>