pull/1876/head^2
kunfei 3 years ago
parent d34e3dbdc8
commit b7b114881d
  1. 9
      app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt

@ -56,10 +56,6 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
}
private val replaceRules
get() = callback.book?.let {
ContentProcessor.get(it.name, it.origin).getTitleReplaceRules()
}
private var upDisplayTileJob: Coroutine<*>? = null
override fun onCurrentListChanged() {
@ -75,8 +71,9 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
fun upDisplayTitle(startIndex: Int) {
upDisplayTileJob?.cancel()
upDisplayTileJob = Coroutine.async(callback.scope) {
val replaceRules = replaceRules
val useReplace = AppConfig.tocUiUseReplace && callback.book?.getUseReplaceRule() == true
val book = callback.book ?: return@async
val replaceRules = ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
val useReplace = AppConfig.tocUiUseReplace && book.getUseReplaceRule()
val items = getItems()
async {
for (i in startIndex until items.size) {

Loading…
Cancel
Save