diff --git a/imageselector/src/main/java/com/donkingliang/imageselector/adapter/ImagePagerAdapter.java b/imageselector/src/main/java/com/donkingliang/imageselector/adapter/ImagePagerAdapter.java index e182c1c..477a84c 100644 --- a/imageselector/src/main/java/com/donkingliang/imageselector/adapter/ImagePagerAdapter.java +++ b/imageselector/src/main/java/com/donkingliang/imageselector/adapter/ImagePagerAdapter.java @@ -6,6 +6,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.viewpager.widget.PagerAdapter; + +import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; @@ -76,18 +78,18 @@ public Object instantiateItem(ViewGroup container, final int position) { if (image.isGif()) { currentView.setScaleType(ImageView.ScaleType.FIT_CENTER); Glide.with(mContext).load(isAndroidQ ? image.getUri() : image.getPath()) - .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE)) + .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE)).override(720,1080) .into(currentView); } else { Glide.with(mContext).asBitmap() .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE)) - .load(isAndroidQ ? image.getUri() : image.getPath()).into(new SimpleTarget() { + .load(isAndroidQ ? image.getUri() : image.getPath()).into(new SimpleTarget(720,1080) { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { int bw = resource.getWidth(); int bh = resource.getHeight(); - if (bw > 8192 || bh > 8192) { - Bitmap bitmap = ImageUtil.zoomBitmap(resource, 8192, 8192); + if (bw > 4096 || bh > 4096) { + Bitmap bitmap = ImageUtil.zoomBitmap(resource, 4096, 4096); setBitmap(currentView, bitmap); } else { setBitmap(currentView, resource);