Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Feb 14, 2024
1 parent 4119231 commit db8f9ca
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import io.legado.app.utils.getCompatColor
import io.legado.app.utils.showDialogFragment
import io.legado.app.utils.toastOnUi
import java.util.concurrent.Executors
import java.util.concurrent.ThreadFactory
import kotlin.math.min

/**
Expand Down Expand Up @@ -58,11 +57,6 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
private val pageDelegate get() = callBack.pageDelegate
private var pageOffset = 0
private var autoPager: AutoPager? = null
private val renderThread by lazy {
Executors.newSingleThreadExecutor {
Thread(it, "TextPageRender")
}
}
private val renderRunnable by lazy { Runnable { preRenderPage() } }

//绘制图片的paint
Expand Down Expand Up @@ -699,6 +693,14 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
return callBack.onLongScreenshotTouchEvent(event)
}

companion object {
private val renderThread by lazy {
Executors.newSingleThreadExecutor {
Thread(it, "TextPageRender")
}
}
}

interface CallBack {
val headerHeight: Int
val pageFactory: TextPageFactory
Expand Down

0 comments on commit db8f9ca

Please sign in to comment.