Merge remote-tracking branch 'origin/master'

This commit is contained in:
kunfei 2022-10-01 13:06:53 +08:00
commit fa1e43f797
9 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -1 +1 @@
{"x86_64":"74ea18a90451c8e224c8681d882b7e50","armeabi-v7a":"bf5207a8e5468058c448876d46394e2c","arm64-v8a":"580ab3f059d60f3223a83f51bf845dfd","x86":"381ed72dbb89c613428e1ebb09870318","version":"106.0.5249.65"}
{"x86_64":"c27a3027ec4c8eba8ba5a2aab547eb04","armeabi-v7a":"b3e0bccf799324ea4177c9e1752b02f1","arm64-v8a":"8cfa3bfe215024cf486d1cffeed87241","x86":"461acafc8701b6b74f8a6b2c024d434e","version":"106.0.5249.79"}

View File

@ -13,6 +13,7 @@
**2022/09/28**
* 更新cronet: 106.0.5249.79
* 更新cronet: 106.0.5249.65
* 正文选择菜单朗读按钮长按可切换朗读选择内容和从选择开始处一直朗读
* 修复某些情况下无法搜索到标题的bug净化规则较多的可能会降低搜索速度

View File

@ -28,6 +28,6 @@ object EventBus {
const val TIP_COLOR = "tipColor"
const val SOURCE_CHANGED = "sourceChanged"
const val SEARCH_RESULT = "searchResult"
const val BOOK_URL_CHANGED = "bookUrlChanged"
const val FILE_SOURCE_DOWNLOAD_DONE = "fileSourceDownloadDone"
const val updateReadActionBar = "updateReadActionBar"
}

View File

@ -66,7 +66,7 @@ class ImportOnLineBookFileViewModel(app: Application) : BaseViewModel(app) {
fun importOnLineBookFile(url: String, fileName: String, success: () -> Unit) {
execute {
LocalBook.importFileOnLine(url, fileName, bookSource).let {
postEvent(EventBus.BOOK_URL_CHANGED, it.bookUrl)
postEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE, it.bookUrl)
}
}.onSuccess {
success.invoke()

View File

@ -535,7 +535,7 @@ class BookInfoActivity :
}
override fun observeLiveBus() {
observeEvent<String>(EventBus.BOOK_URL_CHANGED) {
observeEvent<String>(EventBus.FILE_SOURCE_DOWNLOAD_DONE) {
viewModel.changeToLocalBook(it)
}
}

View File

@ -32,7 +32,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
var inBookshelf = false
var bookSource: BookSource? = null
private var changeSourceCoroutine: Coroutine<*>? = null
var isImportBookOnLine = false
val isImportBookOnLine: Boolean
get() = (bookSource?.bookSourceType ?: BookType.local) == BookType.file
fun initData(intent: Intent) {
execute {
@ -76,7 +77,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
upCoverByRule(book)
bookSource = if (book.isLocalBook()) null else
appDb.bookSourceDao.getBookSource(book.origin)
isImportBookOnLine = (bookSource?.bookSourceType ?: BookType.local) == BookType.file
if (book.tocUrl.isEmpty()) {
loadBookInfo(book)
} else if (isImportBookOnLine) {
@ -306,7 +306,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
fun changeToLocalBook(bookUrl: String) {
appDb.bookDao.getBook(bookUrl)?.let { localBook ->
isImportBookOnLine = false
inBookshelf = true
LocalBook.mergeBook(localBook, bookData.value).let {
bookData.postValue(it)

View File

@ -27,6 +27,6 @@ android.experimental.enableNewResourceShrinker.preciseShrinking=true
# and none from the library's dependencies, thereby reducing the size of the R class for that library.
android.nonTransitiveRClass=true
#https://chromiumdash.appspot.com/releases?platform=Android
CronetVersion=106.0.5249.65
CronetVersion=106.0.5249.79
android.injected.testOnly=false