Created
May 13, 2018 13:41
-
-
Save vsay01/7341e0f78f3330af91106bf42cb2e93a to your computer and use it in GitHub Desktop.
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
| Glide.with(mContext) | |
| .load(imageURL) | |
| .asBitmap() | |
| .transcode(new PaletteBitmapTranscoder(mContext), PaletteBitmap.class) | |
| .fitCenter() | |
| .placeholder(R.drawable.placeholder) | |
| .error(R.drawable.placeholder_error) | |
| .diskCacheStrategy(DiskCacheStrategy.ALL) | |
| .into(new ImageViewTarget<PaletteBitmap>(holder.imageView) { | |
| @Override | |
| protected void setResource(PaletteBitmap resource) { | |
| super.view.setImageBitmap(resource.bitmap); | |
| Palette p = resource.palette; | |
| holder.mPaletteColor = p.getMutedColor(ContextCompat.getColor(mContext, R.color.default)); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment