Skip to content

Instantly share code, notes, and snippets.

@seventhmoon
Created September 8, 2015 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seventhmoon/1e2cd5fd098cc88b8ae1 to your computer and use it in GitHub Desktop.
Save seventhmoon/1e2cd5fd098cc88b8ae1 to your computer and use it in GitHub Desktop.
Palette with Glide
Glide.with(this)
.load(url)
.asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).centerCrop()
.into(new BitmapImageViewTarget(mImageViewBackdrop) {
@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) {
int mutedColor = palette.getMutedColor(0x000000);
//todo: set actionbar color
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment