title: Gif loaded with Glide in RecyclerView Adapter not playing properly
body: <p>I have a recyclerview which shows a list of images in horizontal view. I want to show a gif around each imageview like an outline similar to instagram's story view.</p>
  
  <p>Here is the code for loading the same.</p>
  
  <pre><code>GlideApp
          .with(itemView.context).asGif()
          .load(R.drawable.red)
          .error(R.drawable.red)
          .diskCacheStrategy(DiskCacheStrategy.DATA)
          .into(ivBackground)
  </code></pre>
  
  <p>I tried adding this code on both places i.e. <code>onCreateViewHolder</code> as well as <code>onBindViewHolder</code> but the gif is not playing properly. </p>
  
  <p>It only shows one frame at a time. If I pause current activity by pressing the back button and then from recent app menu, navigate back to the app, then it shows the next frame.</p>
  
  <p>My gif is stored in the drawable folder and I have the exact same gif working properly in an activity/fragment. </p>
  
  <p>Issue is it's not playing properly inside a recyclerview adapter.</p>
  
  <p>This is the complete adapter class.</p>
  
  <pre><code>    class LiveViewAdapter(
      val context: Context,
      val liveList: ArrayList&lt;DataItem&gt;,
      private val listener: LiveViewAdapterListener
  ) :
      RecyclerView.Adapter&lt;LiveViewHolder&gt;() {
      private val inflater: LayoutInflater
  
      interface LiveViewAdapterListener {
          fun onLiveClicked(url: String)
      }
  
      init {
  
          inflater = LayoutInflater.from(context)
      }
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LiveViewHolder {
          val view = inflater.inflate(R.layout.item_live, parent, false)
  
          return LiveViewHolder(view)
      }
  
      override fun getItemCount(): Int {
          return liveList.size
      }
  
      override fun onBindViewHolder(holder: LiveViewHolder, position: Int) {
          val requestOptions = RequestOptions().apply {
              placeholder(R.mipmap.ic_launcher_round)
              error(R.mipmap.ic_launcher_round)
          }
          val videoId = liveList[holder.adapterPosition].liveUrl?.substring(liveList[holder.adapterPosition].liveUrl?.lastIndexOf("=")!! + 1)
          val imageUrl = "https://img.youtube.com/vi/$videoId/hqdefault.jpg"
          Glide.with(context)
              .load(liveList[position].liveUrl)
              .apply(requestOptions)
              .thumbnail(Glide.with(context).load(imageUrl))
              .into(holder.ivLive)
  
  
          holder.ivLive.setOnClickListener {
              listener.onLiveClicked(liveList[holder.adapterPosition].liveUrl!!)
          }
      }
  }
  </code></pre>
  
  <p>Glide version used</p>
  
  <pre><code>implementation 'com.github.bumptech.glide:glide:4.8.0'
  kapt 'com.github.bumptech.glide:compiler:4.8.0'
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I figured out that the above code works fine on android devices which have sdk version less than pie. On devices with android pie, it's not working properly.</p>