Skip to content

Instantly share code, notes, and snippets.

@dp-singh
Created April 8, 2015 17:41
Show Gist options
  • Select an option

  • Save dp-singh/8bf39f7dfd65f5820340 to your computer and use it in GitHub Desktop.

Select an option

Save dp-singh/8bf39f7dfd65f5820340 to your computer and use it in GitHub Desktop.
Image rendering with blur effect
Transformation blurTransformation = new Transformation() {
@Override
public Bitmap transform(Bitmap source) {
Bitmap blurred = Blur.fastblur(LiveImageView.this.context, source, 10);
source.recycle();
return blurred;
}
@Override
public String key() {
return "blur()";
}
};
Picasso.with(context)
.load(thumbUrl) // thumbnail url goes here
.placeholder(R.drawable.placeholder)
.resize(imageViewWidth, imageViewHeight)
.transform(blurTransformation)
.into(imageView, new Callback() {
@Override
public void onSuccess() {
Picasso.with(context)
.load(url) // image url goes here
.resize(imageViewWidth, imageViewHeight)
.skipMemoryCache() // skipping LruCache for large photos only (not for thumbnails)
.placeholder(imageView.getDrawable())
.into(imageView);
}
@Override
public void onError() {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment