diff --git a/app/src/main/java/io/legado/app/service/help/ReadBook.kt b/app/src/main/java/io/legado/app/service/help/ReadBook.kt index 68b1601ac..50cadd655 100644 --- a/app/src/main/java/io/legado/app/service/help/ReadBook.kt +++ b/app/src/main/java/io/legado/app/service/help/ReadBook.kt @@ -33,7 +33,7 @@ object ReadBook { var curTextChapter: TextChapter? = null var nextTextChapter: TextChapter? = null var webBook: WebBook? = null - var msg: String? = null + private var msg: String? = null private val loadingChapters = arrayListOf() fun resetData(book: Book, noSource: (name: String, author: String) -> Unit) { @@ -64,6 +64,11 @@ object ReadBook { } } + fun upMsg(msg: String?) { + this.msg = msg + callBack?.upContent() + } + fun moveToNextPage() { durPageIndex++ callBack?.upContent() diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 90d559f8d..25d94bdea 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -117,15 +117,16 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { App.db.bookChapterDao().insert(*cList.toTypedArray()) App.db.bookDao().update(book) ReadBook.chapterSize = cList.size + ReadBook.upMsg(null) ReadBook.loadContent(resetPageOffset = true) } else { changeDruChapterIndex(cList) } } else { - toast(R.string.error_load_toc) + ReadBook.upMsg(context.getString(R.string.error_load_toc)) } }?.onError { - toast(R.string.error_load_toc) + ReadBook.upMsg(context.getString(R.string.error_load_toc)) } } } @@ -133,6 +134,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { fun changeTo(book1: Book) { execute { + ReadBook.upMsg(null) ReadBook.book?.let { App.db.bookDao().delete(it) } @@ -171,11 +173,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } }.onStart { - ReadBook.msg = "正在自动换源" - ReadBook.callBack?.upContent() + ReadBook.upMsg("正在自动换源") }.onFinally { - ReadBook.msg = null - ReadBook.callBack?.upContent() + ReadBook.upMsg(null) } } diff --git a/app/src/main/res/drawable/ic_launcher1_b.xml b/app/src/main/res/drawable/ic_launcher1_b.xml index 559d07c34..c5b40eb91 100644 --- a/app/src/main/res/drawable/ic_launcher1_b.xml +++ b/app/src/main/res/drawable/ic_launcher1_b.xml @@ -7,49 +7,49 @@ - + - - - + + - + android:fillColor="#f2f2f2" /> + - - - - - - + + + + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 0fe58e361..d2c418293 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 59526eefd..2d18ac346 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 58b1e389a..4b44e0bba 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index ea95882bd..df9bfebb8 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index fe1be3fde..6d101d806 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ