Created
October 2, 2017 06:43
-
-
Save rezaiyan/cfd87a0a88c13839617340c910623b7d to your computer and use it in GitHub Desktop.
Load image with glide sample
This file contains 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(context).load(Api.getPosterPath(holder.movie.getPosterPath())) | |
.asBitmap() | |
.diskCacheStrategy(DiskCacheStrategy.RESULT) | |
.into(new BitmapImageViewTarget(holder.poster) | |
{ | |
@Override | |
public void onResourceReady(Bitmap bitmap, GlideAnimation anim) | |
{ | |
super.onResourceReady(bitmap, anim); | |
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() | |
{ | |
@Override | |
public void onGenerated(Palette palette) | |
{ | |
holder.titleBackground.setBackgroundColor(palette.getVibrantColor(context | |
.getResources().getColor(R.color.black_translucent_60))); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment