This commit is contained in:
kunfei
2023-04-03 22:18:38 +08:00
parent 1ac1c26595
commit 21d09ce65a
2 changed files with 9 additions and 0 deletions
@@ -1082,6 +1082,13 @@ class ReadBookActivity : BaseReadBookActivity(),
putExtra("url", it)
IntentData.put(it, ReadBook.bookSource?.getHeaderMap(true))
}
} else if (it.isTrue()) {
//购买成功后刷新目录
ReadBook.book?.let {
ReadBook.curTextChapter = null
BookHelp.delContent(book, chapter)
viewModel.loadChapterList(book)
}
}
}.onError {
AppLog.putDebug(it.localizedMessage)
@@ -2,6 +2,7 @@
package io.legado.app.utils
import android.annotation.SuppressLint
import android.icu.text.Collator
import android.icu.util.ULocale
import android.net.Uri
@@ -84,6 +85,7 @@ fun String.splitNotBlank(regex: Regex, limit: Int = 0): Array<String> = run {
this.split(regex, limit).map { it.trim() }.filterNot { it.isBlank() }.toTypedArray()
}
@SuppressLint("ObsoleteSdkInt")
fun String.cnCompare(other: String): Int {
return if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
Collator.getInstance(ULocale.SIMPLIFIED_CHINESE).compare(this, other)