fix: Release 包中部分页面预加载失败

This commit is contained in:
HuanCheng65 2023-09-22 19:16:25 +08:00
parent 1e99d0fe21
commit 3f1bd7b9b7
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
4 changed files with 13 additions and 6 deletions

View File

@ -275,5 +275,12 @@
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class com.billy.android.preloader.** { *; }
-keep,allowobfuscation,allowshrinking class com.huanchengfly.tieba.post.utils.preload.** { *; }
-if interface * { @retrofit2.http.* <methods>; } -if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1> -keep,allowobfuscation interface <1>
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

View File

@ -104,7 +104,7 @@ object ImageCacheUtil {
private fun getFolderSize(file: File): Long { private fun getFolderSize(file: File): Long {
var size: Long = 0 var size: Long = 0
try { try {
val fileList = file.listFiles() val fileList = file.listFiles() ?: return 0
for (aFileList in fileList) { for (aFileList in fileList) {
size = if (aFileList.isDirectory) { size = if (aFileList.isDirectory) {
size + getFolderSize(aFileList) size + getFolderSize(aFileList)

View File

@ -10,7 +10,7 @@ import com.billy.android.preloader.interfaces.DataLoader;
public final class PreloadUtil { public final class PreloadUtil {
public static final String EXTRA_PRELOAD_ID = "preload_id"; public static final String EXTRA_PRELOAD_ID = "preload_id";
public static void startActivityWithPreload(Context context, Intent intent, DataLoader dataLoader) { public static void startActivityWithPreload(Context context, Intent intent, DataLoader<?> dataLoader) {
context.startActivity(intent.putExtra(EXTRA_PRELOAD_ID, PreLoader.preLoad(dataLoader))); context.startActivity(intent.putExtra(EXTRA_PRELOAD_ID, PreLoader.preLoad(dataLoader)));
} }

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".fragments.PhotoViewFragment"> tools:context=".fragments.PhotoViewFragment">
<com.github.panpf.sketch.zoom.SketchZoomImageView <com.github.panpf.zoomimage.SketchZoomImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"