Horis 2 лет назад
Родитель
Сommit
3f5712165f

+ 8 - 6
app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@@ -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
 
 /**
@@ -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
@@ -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