I need to download image from url and then place it as background of my RelativeLayout. The image (jpeg) size is about 10kb and it has good quality and resolution. But when I try to download the image with Glide it looks compressed (see background image on the screen below).
Glide.with(this)
.load("url...")
.asBitmap()
.format(DecodeFormat.PREFER_ARGB_8888)
.into(new SimpleTarget<Bitmap>(rootViewWidth, rootViewHeight) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
Drawable drawable = new BitmapDrawable(resource);
rootView.setBackground(drawable);
}
});
How can I improve that?
Thank you!

Aucun commentaire:
Enregistrer un commentaire