Created
September 8, 2015 04:06
-
-
Save seventhmoon/1e2cd5fd098cc88b8ae1 to your computer and use it in GitHub Desktop.
Palette with Glide
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(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