|
|
@ -20,6 +20,7 @@ import io.legado.app.utils.longToastOnUi |
|
|
|
import io.legado.app.utils.visible |
|
|
|
import io.legado.app.utils.visible |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.Dispatchers.Main |
|
|
|
import kotlinx.coroutines.Dispatchers.Main |
|
|
|
|
|
|
|
import kotlinx.coroutines.async |
|
|
|
import kotlinx.coroutines.ensureActive |
|
|
|
import kotlinx.coroutines.ensureActive |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import java.util.concurrent.ConcurrentHashMap |
|
|
|
import java.util.concurrent.ConcurrentHashMap |
|
|
@ -79,6 +80,7 @@ class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
|
val replaceRules = replaceRules |
|
|
|
val replaceRules = replaceRules |
|
|
|
val useReplace = useReplace |
|
|
|
val useReplace = useReplace |
|
|
|
val items = getItems() |
|
|
|
val items = getItems() |
|
|
|
|
|
|
|
async { |
|
|
|
for (i in startIndex until items.size) { |
|
|
|
for (i in startIndex until items.size) { |
|
|
|
val item = items[i] |
|
|
|
val item = items[i] |
|
|
|
if (displayTitleMap[item.title] == null) { |
|
|
|
if (displayTitleMap[item.title] == null) { |
|
|
@ -91,7 +93,9 @@ class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (i in 0 until startIndex) { |
|
|
|
}.start() |
|
|
|
|
|
|
|
async { |
|
|
|
|
|
|
|
for (i in startIndex downTo 0) { |
|
|
|
val item = items[i] |
|
|
|
val item = items[i] |
|
|
|
if (displayTitleMap[item.title] == null) { |
|
|
|
if (displayTitleMap[item.title] == null) { |
|
|
|
ensureActive() |
|
|
|
ensureActive() |
|
|
@ -103,6 +107,7 @@ class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}.start() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|