Closed ledangtuanbk closed 8 years ago
+1
+1
+1
So I just tried this for Glide
integration and it works.
@Override
public void loadFullScreenImage(final ImageView iv, String imageUrl, int width, final LinearLayout bgLinearLayout) {
if (!TextUtils.isEmpty(imageUrl)) {
SimpleTarget target = new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(final Bitmap bitmap, GlideAnimation glideAnimation) {
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
public void onGenerated(Palette palette) {
applyPalette(palette, bgLinearLayout);
iv.setImageBitmap(bitmap);
}
});
}
};
Glide.with(iv.getContext())
.load(imageUrl)
.asBitmap()
.override(width, width)
.into(target);
} else {
iv.setImageDrawable(null);
}
}
Hi Team. For some reason, I want to use Glide library to load image instead of Picasso as your example. When I used Glide, The image not able to load Image.
My code like that:
public void loadFullScreenImage(final ImageView iv, final String imageUrl, int width, final LinearLayout bgLinearLayout) { Log.d(TAG, "loadFullScreenImage: " + imageUrl); Glide.with(iv.getContext()).load(imageUrl).into(iv); } else { iv.setImageDrawable(null); } }
Please help me to do it. Thank you very much.