title: Update RecyclerView item's height after image was loaded?
body: <p>I have a <code>RecyclerView</code> with <code>LinearLayoutManager</code>. I want to have a picture as a background, but picture size is dynamic. I want it to be full width and have height accordingly.  This is what I currently have:</p>
  
  <p><a href="https://i.stack.imgur.com/TsVvl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TsVvl.png" alt="enter image description here"></a></p>
  
  <p>I tried this:</p>
  
  <pre><code>Picasso.with(context).load(pictureUrl).into(new Target() {
          @Override
          public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom)
          {
              holder.picture.setImageBitmap(bitmap);
  
              RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) holder.itemView.getLayoutParams();
              params.height = bitmap.getHeight();
              holder.itemView.setLayoutParams(params);
              //notifyItemChanged(position);
          }
  
          @Override public void onBitmapFailed(Drawable drawable) {}
          @Override public void onPrepareLoad(Drawable drawable) {}
      });
  </code></pre>
  
  <p>But then it doesn't even load at all:</p>
  
  <p><a href="https://i.stack.imgur.com/nOxcl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nOxcl.png" alt="enter image description here"></a></p>
  
  <p>EDIT: it seems, that <code>onBitmapLoaded()</code> doesn't even get called, although <code>onPrepareLoad()</code> does get.</p>