From 4f3de156bd0b0bc7e4f3de35606985f566c6e71e Mon Sep 17 00:00:00 2001 From: GKF Date: Tue, 18 Jun 2019 11:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/bookshelf/BookshelfActivity.kt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/bookshelf/BookshelfActivity.kt b/app/src/main/java/io/legado/app/ui/bookshelf/BookshelfActivity.kt index f0af48ac7..1c799b900 100644 --- a/app/src/main/java/io/legado/app/ui/bookshelf/BookshelfActivity.kt +++ b/app/src/main/java/io/legado/app/ui/bookshelf/BookshelfActivity.kt @@ -53,9 +53,23 @@ class BookshelfActivity : BaseActivity() { this, Observer { pageList -> bookshelfAdapter.submitList(pageList) }) } - else -> { + -2 -> { + + } + -3 -> { } + else -> { + bookshelfLiveData?.removeObservers(this) + bookshelfLiveData = + LivePagedListBuilder( + App.db.bookDao().observeByGroup(it.groupId), + 10 + ).build() + bookshelfLiveData?.observe( + this, + Observer { pageList -> bookshelfAdapter.submitList(pageList) }) + } } } }