From 78f290eef83f0d6434807b027e5fcf3835e6343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E5=B0=8F=E6=B1=9F?= <461355754@qq.com> Date: Wed, 21 Jan 2026 12:46:32 +0800 Subject: [PATCH] =?UTF-8?q?1:=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E5=8E=86=E5=8F=B2=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD=202=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA=E6=B7=BB=E5=8A=A0=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=203=EF=BC=9A=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=BE=A4=E7=AE=A1=E7=90=86=E5=91=98=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xscm/moduleutil/utils/ImageLoader.java | 214 ++++++++++++- .../com/xscm/moduleutil/utils/ImageUtils.java | 288 +++++++++++++++++- .../adapter/GroupUserListAdapter.kt | 2 +- .../src/main/res/layout/activity_search.xml | 3 +- 4 files changed, 489 insertions(+), 18 deletions(-) diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageLoader.java b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageLoader.java index 64fa41a9..a6a6d143 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageLoader.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageLoader.java @@ -9,18 +9,25 @@ import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.text.TextUtils; +import android.util.Log; import android.view.View; import android.widget.ImageView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import com.blankj.utilcode.util.LogUtils; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.DecodeFormat; import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.model.GlideUrl; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; +import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.Target; import com.bumptech.glide.signature.ObjectKey; @@ -48,22 +55,153 @@ public class ImageLoader { public static void loadHead(Context context, ImageView view, String url) { RequestOptions options = RequestOptions.circleCropTransform(); - Glide.with(context).load(url).apply(createUrlOnlyOptions(url)).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).thumbnail(0.3f).into(view); + Glide.with(context).load(url).apply(createUrlOnlyOptions(url)).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }).thumbnail(0.3f).into(view); } public static void loadHead(ImageView view, String url) { RequestOptions options = RequestOptions.circleCropTransform(); - Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).thumbnail(0.3f).into(view); + Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }).thumbnail(0.3f).into(view); } public static void loadImage(ImageView view, String url) { RequestOptions options = RequestOptions.circleCropTransform(); - Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_image).placeholder(R.mipmap.default_image).thumbnail(0.3f).into(view); + Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_image).placeholder(R.mipmap.default_image) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }).thumbnail(0.3f).into(view); } public static void loadImage(Context context, ImageView view, String url) { Glide.with(context).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_image).placeholder(R.mipmap.default_image) - .thumbnail(0.3f).into(view); + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }).thumbnail(0.3f).into(view); } /** * 加载图片并灰度 @@ -74,13 +212,79 @@ public class ImageLoader { */ public static void loadImage(Context context,ImageView view, String url, Float placeholder) { Glide.with(context).load(url).apply(RequestOptions.bitmapTransform(new GrayscaleTransformation(placeholder))) - .error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.3f).into(view); + .error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.RESOURCE) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }).thumbnail(0.3f).into(view); } // 可调节灰度程度的方法 public static void loadGrayscaleImage(Context context, String url, ImageView imageView, float saturation) { Glide.with(context) .load(url) .apply(RequestOptions.bitmapTransform(new GrayscaleTransformation(saturation))) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",url); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",url); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",url); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",url); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+url, e); + return false; + } + }) .into(imageView); } diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageUtils.java b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageUtils.java index 73aa3087..fdd6079a 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageUtils.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ImageUtils.java @@ -14,6 +14,7 @@ import android.graphics.RectF; import android.graphics.Shader; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.text.TextUtils; @@ -29,6 +30,7 @@ import androidx.annotation.RequiresApi; import androidx.vectordrawable.graphics.drawable.Animatable2Compat; import com.blankj.utilcode.util.ConvertUtils; +import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.Utils; import com.bumptech.glide.Glide; import com.bumptech.glide.integration.webp.decoder.WebpDrawable; @@ -80,7 +82,9 @@ public class ImageUtils { private static RequestOptions createUrlOnlyOptions(String url) { return new RequestOptions().signature(new ObjectKey(url!=null ? url :"")).diskCacheStrategy(DiskCacheStrategy.ALL) .skipMemoryCache(false) - .format(DecodeFormat.PREFER_RGB_565); + .format(DecodeFormat.PREFER_RGB_565) + .error(new ColorDrawable(Color.TRANSPARENT)); // 透明错误图; + // 禁止尺寸影响缓存 // .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL); } @@ -89,7 +93,40 @@ public class ImageUtils { * 默认加载 */ public static void loadImageView(String path, ImageView mImageView) { - Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).thumbnail(0.3f).into(mImageView); + Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).thumbnail(0.3f).into(mImageView); } /** @@ -97,7 +134,40 @@ public class ImageUtils { */ public static void loadIcon(String path, ImageView mImageView) { mImageView.setVisibility(TextUtils.isEmpty(path) ? GONE : View.VISIBLE); - Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).thumbnail(0.3f).into(mImageView); + Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).thumbnail(0.3f).into(mImageView); } /** @@ -117,7 +187,40 @@ public class ImageUtils { */ public static void loadSample(String path, ImageView mImageView, int width, int height) { RequestOptions options = new RequestOptions().override(width, height).diskCacheStrategy(DiskCacheStrategy.RESOURCE); - Glide.with(mImageView).load(path).apply(options).thumbnail(0.3f).into(mImageView); + Glide.with(mImageView).load(path).apply(options) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).thumbnail(0.3f).into(mImageView); } /** @@ -210,7 +313,39 @@ public class ImageUtils { } } Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).error(errorRes). - placeholder(errorRes).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).thumbnail(0.3f).into(mImageView); + placeholder(errorRes).centerCrop().listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).thumbnail(0.3f).into(mImageView); } @@ -227,7 +362,40 @@ public class ImageUtils { } } Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)) - .placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.3f).into(mImageView); + .placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).thumbnail(0.3f).into(mImageView); } public static void loadHeadCC(String path, ImageView mImageView) { @@ -243,7 +411,8 @@ public class ImageUtils { } Glide.with(mImageView).asBitmap().load(path) .apply(createUrlOnlyOptions(path)) - .error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().thumbnail(0.3f).into(mImageView); + .error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop() + .thumbnail(0.3f).into(mImageView); } public static void loadHead(String path, ImageView mImageView) { @@ -258,7 +427,39 @@ public class ImageUtils { } } Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)) - .thumbnail(0.3f).into(mImageView); + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }) .thumbnail(0.3f).into(mImageView); } public static void loadHeadCC(String path, ImageView mImageView, LinearLayout.LayoutParams params) { @@ -307,18 +508,83 @@ public class ImageUtils { } public static void loadCenterCrop(String path, ImageView mImageView) { - Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).centerCrop().into(mImageView); + Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).centerCrop() + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).into(mImageView); } public static void loadRes(int path, ImageView mImageView) { - Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).into(mImageView); + Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE) + .listener(new RequestListener() { + @Override + public boolean onResourceReady(Drawable resource, Object model, + Target target, DataSource dataSource, + boolean isFirstResource) { + // dataSource 是关键参数! + switch (dataSource) { + case DATA_DISK_CACHE: + case RESOURCE_DISK_CACHE: + LogUtils.e("GlideCache", "来自磁盘缓存",path); + break; + case MEMORY_CACHE: + LogUtils.e("GlideCache", "来自内存缓存",path); + break; + case LOCAL: // 本地文件 + LogUtils.e("GlideCache", "来自本地文件",path); + break; + case REMOTE: // 网络下载 + LogUtils.e("GlideCache", "来自网络下载",path); + break; + default: + LogUtils.e("GlideCache", "来自: " + dataSource); + } + return false; + } + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, + Target target, boolean isFirstResource) { + Log.e("GlideCache", "加载失败"+"path:"+path, e); + return false; + } + }).into(mImageView); } /** * 加载图片(优先使用本地缓存,无缓存则下载) * - * @param context 上下文 * @param url 图片 URL * @param imageView 目标 ImageView */ diff --git a/MainModule/src/main/java/com/xscm/modulemain/adapter/GroupUserListAdapter.kt b/MainModule/src/main/java/com/xscm/modulemain/adapter/GroupUserListAdapter.kt index 922c442f..83c5cfcb 100644 --- a/MainModule/src/main/java/com/xscm/modulemain/adapter/GroupUserListAdapter.kt +++ b/MainModule/src/main/java/com/xscm/modulemain/adapter/GroupUserListAdapter.kt @@ -85,7 +85,7 @@ class GroupUserListAdapter : private fun showOptionsDialog(ismute: Int, item: GroupBean.GroupUserBean?, b: Boolean) { val options = arrayOf( if (ismute == 1) "解禁" else "禁言", - if (b) "设置成普通成员" else "设置成管理员" + if (b) "取消管理员" else "设置管理员" ) if (isOwner != 1){ options[1] = "" diff --git a/MainModule/src/main/res/layout/activity_search.xml b/MainModule/src/main/res/layout/activity_search.xml index 67c0e5d3..6c546014 100644 --- a/MainModule/src/main/res/layout/activity_search.xml +++ b/MainModule/src/main/res/layout/activity_search.xml @@ -106,7 +106,8 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" - android:visibility="gone" /> + android:src="@mipmap/dele_foot" + />