优化
This commit is contained in:
@@ -31,7 +31,6 @@ import io.legado.app.help.glide.OkHttpModelLoader
|
|||||||
import io.legado.app.model.analyzeRule.AnalyzeRule
|
import io.legado.app.model.analyzeRule.AnalyzeRule
|
||||||
import io.legado.app.model.analyzeRule.AnalyzeRule.Companion.setCoroutineContext
|
import io.legado.app.model.analyzeRule.AnalyzeRule.Companion.setCoroutineContext
|
||||||
import io.legado.app.model.analyzeRule.AnalyzeUrl
|
import io.legado.app.model.analyzeRule.AnalyzeUrl
|
||||||
import io.legado.app.ui.book.manga.entities.EpaperTransformation
|
|
||||||
import io.legado.app.utils.BitmapUtils
|
import io.legado.app.utils.BitmapUtils
|
||||||
import io.legado.app.utils.GSON
|
import io.legado.app.utils.GSON
|
||||||
import io.legado.app.utils.fromJsonObject
|
import io.legado.app.utils.fromJsonObject
|
||||||
@@ -133,7 +132,6 @@ object BookCover {
|
|||||||
/**
|
/**
|
||||||
* 加载漫画图片
|
* 加载漫画图片
|
||||||
*/
|
*/
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
fun loadManga(
|
fun loadManga(
|
||||||
context: Context,
|
context: Context,
|
||||||
path: String?,
|
path: String?,
|
||||||
@@ -153,10 +151,11 @@ object BookCover {
|
|||||||
.skipMemoryCache(true).let {
|
.skipMemoryCache(true).let {
|
||||||
if (transformation != null) {
|
if (transformation != null) {
|
||||||
it.transform(transformation)
|
it.transform(transformation)
|
||||||
}
|
} else {
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun preloadManga(
|
fun preloadManga(
|
||||||
context: Context,
|
context: Context,
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ open class MangaVH<VB : ViewBinding>(val binding: VB, private val context: Conte
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
fun loadImageWithRetry(imageUrl: String, isHorizontal: Boolean, isLastImage: Boolean,transformation: Transformation<Bitmap>?) {
|
fun loadImageWithRetry(
|
||||||
|
imageUrl: String,
|
||||||
|
isHorizontal: Boolean,
|
||||||
|
isLastImage: Boolean,
|
||||||
|
transformation: Transformation<Bitmap>?
|
||||||
|
) {
|
||||||
mFlProgress.isVisible = true
|
mFlProgress.isVisible = true
|
||||||
mLoading.isVisible = true
|
mLoading.isVisible = true
|
||||||
mRetry?.isGone = true
|
mRetry?.isGone = true
|
||||||
|
|||||||
Reference in New Issue
Block a user