|
|
|
@ -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) { |
|
|
|
|