Search code examples
androidpicassoandroid-glide

How do I convert translate this Picasso code into Glide?


So, I am writing an Android application based on this tutorial (https://www.youtube.com/watch?v=RCCCLcD4xbY) as a reference, and right now, I have reached the ImageAdapter part. Since I want to use Glide instead of Picasso, I would like to change this line

Picasso.with(mContext).load("http://image.tmdb.org/t/p/w185/" + array.get(position)).
                    resize(width, (int)(width*1.5)).placeholder(d).into(imageView);

into its Picasso equivalent.

You can also see the complete ImageAdapter code here to make things clearer: http://pastebin.com/K7ZCwqid


Solution

  • Glide.with(mContext)
        .load("http://image.tmdb.org/t/p/w185/" + array.get(position))
        .override(width, (int)(width*1.5))
        .placeholder(d)
        .into(imageView);