1:羽声新版本

This commit is contained in:
2025-10-24 17:52:11 +08:00
parent 437a623f81
commit a809b02ebb
827 changed files with 25795 additions and 1193698 deletions

View File

@@ -150,25 +150,30 @@ public class ImageUtils {
return;
}
// 没有缓存,正常加载
SVGAParser parser = SVGAParser.Companion.shareParser();
parser.decodeFromInputStream(mImageView.getContext().getResources().openRawResource(resourceId), "", new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
if (mImageView != null) {
// 缓存实体
svgaCache.put(resourceId, svgaVideoEntity);
SVGADrawable svgaDrawable = new SVGADrawable(svgaVideoEntity);
mImageView.setImageDrawable(svgaDrawable);
mImageView.startAnimation();
try {
// 没有缓存,正常加载
SVGAParser parser = SVGAParser.Companion.shareParser();
InputStream inputStream = mImageView.getContext().getResources().openRawResource(resourceId);
parser.decodeFromAssets("heart_line_31.svga", new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
if (mImageView != null) {
// 缓存实体
svgaCache.put(resourceId, svgaVideoEntity);
SVGADrawable svgaDrawable = new SVGADrawable(svgaVideoEntity);
mImageView.setImageDrawable(svgaDrawable);
mImageView.startAnimation();
}
}
}
@Override
public void onError() {
Logger.e("loadDecorationAvatar2 error");
}
}, true);
@Override
public void onError() {
Logger.e("loadDecorationAvatar2 error, resourceId: " + resourceId);
}
});
} catch (Exception e) {
Logger.e("loadDecorationAvatar2 exception, resourceId: " + resourceId, e);
}
} else {
Logger.e("Resource ID is 0 or invalid");
}
@@ -176,6 +181,7 @@ public class ImageUtils {
public static void loadHeadCC(String path, ImageView mImageView) {
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
@@ -195,6 +201,7 @@ public class ImageUtils {
public static void loadRes(int path, ImageView mImageView) {
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
}
/**
@@ -561,5 +568,8 @@ public class ImageUtils {
}
}
public static void clearDiskCache(Context context){
Glide.get(context).clearDiskCache();
}
}