From 6818b03bf9e648151e020da8fe9456ec0f329919 Mon Sep 17 00:00:00 2001 From: lixun Date: Sat, 2 Apr 2022 20:20:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=A4=A7=E5=9B=BE=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E7=85=A7=E7=89=87=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E5=BC=80=E6=94=BE=E5=AE=B9=E5=99=A8photoview=20=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E5=A4=96=E9=83=A8=E8=AE=BE=E7=BD=AE=E5=AE=83=E7=9A=84?= =?UTF-8?q?=E8=A7=A6=E6=91=B8=E4=BA=8B=E4=BB=B6=EF=BC=88=E5=8C=85=E6=8B=AC?= =?UTF-8?q?touchListener=20=E7=BC=A9=E6=94=BE=E6=AF=94=E4=BE=8B=20=20?= =?UTF-8?q?=E5=8D=95=E5=87=BB=20=E5=8F=8C=E5=87=BB=E7=AD=89=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E7=9A=84=E5=93=8D=E5=BA=94=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/luck/pictureselector/CoilEngine.kt | 1 + app/src/main/java/com/luck/pictureselector/GlideEngine.java | 2 +- app/src/main/java/com/luck/pictureselector/PicassoEngine.java | 2 +- .../com/luck/picture/lib/PictureSelectorPreviewFragment.java | 2 +- .../com/luck/picture/lib/adapter/holder/BasePreviewHolder.java | 2 +- .../src/main/java/com/luck/picture/lib/engine/ImageEngine.java | 3 ++- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/luck/pictureselector/CoilEngine.kt b/app/src/main/java/com/luck/pictureselector/CoilEngine.kt index 524540c43..d1c85c677 100644 --- a/app/src/main/java/com/luck/pictureselector/CoilEngine.kt +++ b/app/src/main/java/com/luck/pictureselector/CoilEngine.kt @@ -33,6 +33,7 @@ class CoilEngine : ImageEngine { url: String, maxWidth: Int, maxHeight: Int, + imageView: ImageView?, call: OnCallbackListener? ) { if (!ActivityCompatHelper.assertValidRequest(context)) { diff --git a/app/src/main/java/com/luck/pictureselector/GlideEngine.java b/app/src/main/java/com/luck/pictureselector/GlideEngine.java index d132032af..209b80130 100644 --- a/app/src/main/java/com/luck/pictureselector/GlideEngine.java +++ b/app/src/main/java/com/luck/pictureselector/GlideEngine.java @@ -51,7 +51,7 @@ public void loadImage(@NonNull Context context, @NonNull String url, @NonNull Im * @param call 回调接口 */ @Override - public void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight, OnCallbackListener call) { + public void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight, ImageView imageView,OnCallbackListener call) { if (!ActivityCompatHelper.assertValidRequest(context)) { return; } diff --git a/app/src/main/java/com/luck/pictureselector/PicassoEngine.java b/app/src/main/java/com/luck/pictureselector/PicassoEngine.java index 8eaa7ae9b..b469f6a72 100644 --- a/app/src/main/java/com/luck/pictureselector/PicassoEngine.java +++ b/app/src/main/java/com/luck/pictureselector/PicassoEngine.java @@ -64,7 +64,7 @@ public void loadImage(@NonNull Context context, @NonNull String url, @NonNull Im * @param call 回调接口 */ @Override - public void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight, OnCallbackListener call) { + public void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight, ImageView imageView, OnCallbackListener call) { if (!ActivityCompatHelper.assertValidRequest(context)) { return; } diff --git a/selector/src/main/java/com/luck/picture/lib/PictureSelectorPreviewFragment.java b/selector/src/main/java/com/luck/picture/lib/PictureSelectorPreviewFragment.java index 9b9f69697..a745f1778 100644 --- a/selector/src/main/java/com/luck/picture/lib/PictureSelectorPreviewFragment.java +++ b/selector/src/main/java/com/luck/picture/lib/PictureSelectorPreviewFragment.java @@ -1388,7 +1388,7 @@ private void changeMagicalViewParams(int position) { setMagicalViewParams(size[0], size[1], position); } else { PictureSelectionConfig.imageEngine.loadImageBitmap(getActivity(), media.getAvailablePath(), - maxImageSize[0], maxImageSize[1], new OnCallbackListener() { + maxImageSize[0], maxImageSize[1], null, new OnCallbackListener() { @Override public void onCall(Bitmap bitmap) { if (ActivityCompatHelper.isDestroy(getActivity())) { diff --git a/selector/src/main/java/com/luck/picture/lib/adapter/holder/BasePreviewHolder.java b/selector/src/main/java/com/luck/picture/lib/adapter/holder/BasePreviewHolder.java index 3edfca874..cc86d8a91 100644 --- a/selector/src/main/java/com/luck/picture/lib/adapter/holder/BasePreviewHolder.java +++ b/selector/src/main/java/com/luck/picture/lib/adapter/holder/BasePreviewHolder.java @@ -114,7 +114,7 @@ public boolean onLongClick(View view) { protected void loadImageBitmap(final LocalMedia media, int maxWidth, int maxHeight) { if (PictureSelectionConfig.imageEngine != null) { - PictureSelectionConfig.imageEngine.loadImageBitmap(itemView.getContext(), media.getAvailablePath(), maxWidth, maxHeight, + PictureSelectionConfig.imageEngine.loadImageBitmap(itemView.getContext(), media.getAvailablePath(), maxWidth, maxHeight,coverImageView, new OnCallbackListener() { @Override public void onCall(Bitmap bitmap) { diff --git a/selector/src/main/java/com/luck/picture/lib/engine/ImageEngine.java b/selector/src/main/java/com/luck/picture/lib/engine/ImageEngine.java index fe053f745..0f34df46a 100644 --- a/selector/src/main/java/com/luck/picture/lib/engine/ImageEngine.java +++ b/selector/src/main/java/com/luck/picture/lib/engine/ImageEngine.java @@ -30,9 +30,10 @@ public interface ImageEngine { * @param url * @param maxWidth * @param maxHeight + * @param imageView * @param call */ - void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight, + void loadImageBitmap(@NonNull Context context, @NonNull String url, int maxWidth, int maxHeight,ImageView imageView, OnCallbackListener call); /**