PanoramaImageView How to use with Glide?
Opened this issue · 5 comments
BurakDurmus commented
Hi,
I'm using Glide for load images and my image not work well how can fix this issue.
Now only work when I add an image with android:src on xml file.
arnoldcoder commented
It is possible to load images from url? like networkimageview
IanWambai commented
I'm having the same issue
enel1989 commented
You can use the view with Glide if you download the image to a simple target and set it to the view after:
GlideApp.with(panoramaImageView)
.asBitmap()
.load(url)
.listener(listener)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
panoramaImageView.setImageBitmap(resource);
}
});
faizanhaidarkhan commented
You can use the view with Glide if you download the image to a simple target and set it to the view after:
GlideApp.with(panoramaImageView) .asBitmap() .load(url) .listener(listener) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(new SimpleTarget<Bitmap>() { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { panoramaImageView.setImageBitmap(resource); } });
Thanks @enel1989
Worked for me, but not able to scroll yet
akardas16 commented
You can use the view with Glide if you download the image to a simple target and set it to the view after:
GlideApp.with(panoramaImageView) .asBitmap() .load(url) .listener(listener) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(new SimpleTarget<Bitmap>() { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { panoramaImageView.setImageBitmap(resource); } });
Thanks for your answer that was helped me also SimpleTarget depreciated below code may help someone
Glide.with(this)
.asBitmap()
.load("https://www.emlakdream.com/wp-content/uploads/2019/06/bogazici-panorama-unye-1.jpg")
.error(R.drawable.background)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
panoramaImageView.setImageBitmap(resource);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) { }
});