From b62490b7a278a208a7d9b05ba6c821e30699c6e8 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 16 Jun 2020 20:06:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=B7=E6=96=B0=E6=97=B6=E5=8F=AA?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=BD=93=E5=89=8D=E4=B9=A6=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 ++++ app/src/main/java/io/legado/app/ui/main/MainViewModel.kt | 5 +++-- .../io/legado/app/ui/main/bookshelf/books/BooksFragment.kt | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 562e97c02..25114ef87 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,6 +3,10 @@ * 请关注公众号[开源阅读]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 * 新公众号[开源阅读]()已启用,[开源阅读软件]()备用 +**2020/06/16** +* 刷新时只刷新当前书架 +* 修复恢复备份需要退出重进的问题 + **2020/06/15** * 添加 E-Ink 模式 by Modificator * 修复发现打开书时可能的错误 diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index 61c951ae5..4dcd3560d 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -4,6 +4,7 @@ import android.app.Application import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.constant.EventBus +import io.legado.app.data.entities.Book import io.legado.app.data.entities.RssSource import io.legado.app.help.http.HttpHelper import io.legado.app.help.storage.Restore @@ -17,9 +18,9 @@ import kotlinx.coroutines.delay class MainViewModel(application: Application) : BaseViewModel(application) { val updateList = hashSetOf() - fun upChapterList() { + fun upChapterList(books: List) { execute { - App.db.bookDao().hasUpdateBooks.forEach { book -> + books.forEach { book -> if (!updateList.contains(book.bookUrl)) { App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> synchronized(this) { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index e061a510e..f9346c7ef 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -67,7 +67,7 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), refresh_layout.setColorSchemeColors(accentColor) refresh_layout.setOnRefreshListener { refresh_layout.isRefreshing = false - activityViewModel.upChapterList() + activityViewModel.upChapterList(booksAdapter.getItems()) } val bookshelfLayout = getPrefInt(PreferKey.bookshelfLayout) if (bookshelfLayout == 0) {