Skip to content

Instantly share code, notes, and snippets.

@DiegoBravoF
Created January 21, 2016 16:18
Show Gist options
  • Select an option

  • Save DiegoBravoF/de3f21cc49775064befc to your computer and use it in GitHub Desktop.

Select an option

Save DiegoBravoF/de3f21cc49775064befc to your computer and use it in GitHub Desktop.
Picasso Implement
import android.content.Context;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Transformation;
/**
* Created by Diego on 21/01/2016.
*/
public class PicassoImp implements PicassoWrapper {
Context context;
public PicassoImp(Context context) {
this.context = context;
}
@Override
public void loadfromUrl(String url, ImageView imageView) {
Picasso.with(context).load(url).into(imageView);
}
@Override
public void loadfromUrlwithPlaceholder(String url, ImageView imageView, int placeHolder) {
Picasso.with(context).load(url).placeholder(placeHolder).into(imageView);
}
@Override
public void loadfromUrlwithTransformation(String url, ImageView imageView, Transformation transformation) {
Picasso.with(context).load(url).transform(transformation).into(imageView);
}
@Override
public void loadfromUrlwithPlaceholderwithTransformation(String url, ImageView imageView, int placeHolder, Transformation transformation) {
Picasso.with(context).load(url).placeholder(placeHolder).transform(transformation).into(imageView);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment