pull/2344/head
kunfei 2 years ago
parent 79303b7b91
commit a3b648770f
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt
  2. 8
      app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt

@ -2,14 +2,9 @@ package io.legado.app.ui.book.read.page.delegate
import android.graphics.Canvas import android.graphics.Canvas
import io.legado.app.ui.book.read.page.ReadView 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) { class NoAnimPageDelegate(readView: ReadView) : HorizontalPageDelegate(readView) {
override fun setDirection(direction: PageDirection) {
mDirection = direction
}
override fun onAnimStart(animationSpeed: Int) { override fun onAnimStart(animationSpeed: Int) {
if (!isCancel) { if (!isCancel) {
readView.fillPage(mDirection) readView.fillPage(mDirection)

@ -189,11 +189,9 @@ class PhotoView @JvmOverloads constructor(
@SuppressLint("UseCompatLoadingForDrawables") @SuppressLint("UseCompatLoadingForDrawables")
override fun setImageResource(resId: Int) { override fun setImageResource(resId: Int) {
var drawable: Drawable? = null val drawable: Drawable? = kotlin.runCatching {
try { resources.getDrawable(resId, null)
drawable = resources.getDrawable(resId, null) }.getOrNull()
} catch (e: Exception) {
}
setImageDrawable(drawable) setImageDrawable(drawable)
} }

Loading…
Cancel
Save