Created
April 8, 2015 17:41
-
-
Save dp-singh/8bf39f7dfd65f5820340 to your computer and use it in GitHub Desktop.
Image rendering with blur effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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