title: Fresco: Images dissapear after scrolling RecylcerView
body: <p>I have a Horizontal RecyclerView: each item has an image loaded into it using the Facebook Fresco image library. However, while the correct image loads initially as it is scrolled a bit onto the screen, it disappears when the RecyclerView is scrolled further.</p>
  <p>In addition, there are issues where scrolling back and forth puts the wrong image in the wrong item (I assume this is an issue with recycling the viewholders). That said, the text you can see overlaying the items in the below screen shot always displays consistently on the correct item, so this recycling issue is exclusive to the images.</p>
  <p>I can confirm I am passing the SimpleDraweeView the correct URL each time.</p>
  <p>Below are some screens and accompanying logs:</p>
  <p><a href="https://i.stack.imgur.com/KldvO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KldvO.png" alt="screenshot one, showing the image entering from the right" /></a></p>
  <p>Screenshot 1: showing the correct image entering from the right.</p>
  <p>Logs as this is scrolled onto the screen and the image is successfully loaded:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>AbstractDraweeController: controller cbb6b5b 5: onTouchEvent MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=32.860107, y[0]=198.16406, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=464189, downTime=464189, deviceId=0, source=0x1002 }
  AbstractDraweeController: controller c077610 8: setHierarchy: com.facebook.drawee.generic.GenericDraweeHierarchy@d36ab12
  AbstractDraweeController: controller 87baf9c null -&gt; 9: initialize
  AbstractDraweeController: controller c077610 8: setHierarchy: null
  AbstractDraweeController: controller 87baf9c 9: setHierarchy: com.facebook.drawee.generic.GenericDraweeHierarchy@d36ab12
  AbstractDraweeController: controller 87baf9c 9: onAttach: request needs submit
  PipelineDraweeController: controller 87baf9c: getDataSource
  AbstractDraweeController: controller 87baf9c 9: submitRequest: dataSource: ad37da5
  BufferedDiskCache: Did not find image for http://i.imgur.com/OVwFM9ub.jpg in staging area
  BufferedDiskCache: Disk cache read for http://i.imgur.com/OVwFM9ub.jpg
  BufferedDiskCache: Found entry in disk cache for http://i.imgur.com/OVwFM9ub.jpg
  NativeMemoryChunkPool: Used = (7, 188416); Free = (0, 0)
  NativeMemoryChunkPool: get (alloc) (object, size) = (ef2f57a, 16384)
  GenericByteArrayPool: Used = (1, 16384); Free = (0, 0)
  GenericByteArrayPool: get (reuse) (object, size) = (cf34727, 16384)
  GenericByteArrayPool: release (reuse) (object, size) = (cf34727, 16384)
  GenericByteArrayPool: Used = (0, 0); Free = (1, 16384)
  BufferedDiskCache: Successful read from disk cache for http://i.imgur.com/OVwFM9ub.jpg
  TiffUtil: Unsupported orientation
  BitmapPool: Used = (7, 2831360); Free = (0, 0)
  BitmapPool: get (alloc) (object, size) = (8622988, 102400)
  AbstractDraweeController: controller 87baf9c 9: set_final_result @ onNewResult: image: CloseableReference 1a34f21</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/y7ISu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y7ISu.png" alt="enter image description here" /></a></p>
  <p>Screenshot 2: showing the RecyclerView after scrolling further from right to left. This shows the image that was previously loaded into the ViewHolder has now disappeared.</p>
  <p>The following logs are produced between Screenshot 1 and 2:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>AbstractDraweeController: controller cbb6b5b 5: onTouchEvent MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=103.65283, y[0]=144.14063, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=793409, downTime=793409, deviceId=0, source=0x1002 }
  AbstractDraweeController: controller 87baf9c 9: onDetach
  AbstractDraweeController: controller e14aa9d 2: onDetach
  AbstractDraweeController: controller 87baf9c 9: release: image: CloseableReference 1a34f21
  AbstractDraweeController: controller e14aa9d 2: release: image: CloseableReference 61f0be9</code></pre>
  </div>
  </div>
  </p>
  <p>Code:
  ViewHolder XML</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:fresco="http://schemas.android.com/apk/res-auto"
      android:layout_width="120dp"
      android:layout_height="match_parent"
      android:background="#993366"&gt;
  
      &lt;com.facebook.drawee.view.SimpleDraweeView
          android:id="@+id/recycler_drawee_view"
          android:layout_width="110dp"
          android:layout_height="match_parent"
          android:background="#336699"
          fresco:placeholderImage="@drawable/placeholder" /&gt;
  
      &lt;TextView
          android:id="@+id/recycler_text_view"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TEST" /&gt;
  
  &lt;/FrameLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Code: SimpleDraweeView setup</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>GenericDraweeHierarchyBuilder builder =
                  new GenericDraweeHierarchyBuilder(context.getResources());
  mHierarchy = builder
         .setFadeDuration(300)
         .setPlaceholderImage(context.getDrawable(R.drawable.placeholder))
         .build();
  
  ...
  
  mDraweeView.setHierarchy(mHierarchy);
  Uri uri = Uri.parse(imageLink);
  DraweeController controller = Fresco.newDraweeControllerBuilder()
  .setUri(uri)
  .build();
  mDraweeView.setController(controller);</code></pre>
  </div>
  </div>
  </p>
  <p>Code: RecyclerView.Adapter</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>@Override
  public SimpleHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
  View view = LayoutInflater.from(mContext).inflate(R.layout.recycler_view_item, viewGroup, false);
  return new SimpleHolder(view, mHierarchy);
  }
  
  ...
  
  @Override
  public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
  holder.setText(EntryUtils.getFullCaption(mData.get(position)));
  holder.setImage(EntryUtils.getThumbnailLink(mData.get(position)));
  }</code></pre>
  </div>
  </div>
  
  Thank you for your time if you got this far. Please let me know if further details could be useful and I will try to supply them.</p>
  <p>Thanks again.</p>