This commit is contained in:
kunfei
2022-09-28 09:10:38 +08:00
parent 79303b7b91
commit a3b648770f
2 changed files with 3 additions and 10 deletions
@@ -2,14 +2,9 @@ package io.legado.app.ui.book.read.page.delegate
import android.graphics.Canvas
import io.legado.app.ui.book.read.page.ReadView
import io.legado.app.ui.book.read.page.entities.PageDirection
class NoAnimPageDelegate(readView: ReadView) : HorizontalPageDelegate(readView) {
override fun setDirection(direction: PageDirection) {
mDirection = direction
}
override fun onAnimStart(animationSpeed: Int) {
if (!isCancel) {
readView.fillPage(mDirection)
@@ -189,11 +189,9 @@ class PhotoView @JvmOverloads constructor(
@SuppressLint("UseCompatLoadingForDrawables")
override fun setImageResource(resId: Int) {
var drawable: Drawable? = null
try {
drawable = resources.getDrawable(resId, null)
} catch (e: Exception) {
}
val drawable: Drawable? = kotlin.runCatching {
resources.getDrawable(resId, null)
}.getOrNull()
setImageDrawable(drawable)
}