we are using Picasso to load image into image View with resize and offline mode load image . we can also use Picasso to load images from internal storage
Simple load image into image view
picasso.get().load("pase url into this").into(holder.imageView);
resize and Load image in any dimension
picasso.get().load("pase url into
this").resize(480,720).into(holder.imageView);
// here 480 and 720 are dimention of image you can set your dimention as
you want
load image in offline cache so we don't need to load again
Picasso.get().load("pase url into
this").networkPolicy(NetworkPolicy.OFFLINE).into(imageView, new Callback()
{
@Override
public void onSuccess() {
Picasso.get().load("pase url into
this").networkPolicy(NetworkPolicy.OFFLINE).into(imageView);
}
@Override
public void onError(Exception e)
{
Picasso.get().load("pase url into this").into(imageView);
}
});
Comments
Post a Comment