From 8fce75a788bb23c84e3023c666731f642fbcc005 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 26 Feb 2020 21:19:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/arrange/ArrangeBookActivity.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index 95dd84d51..c0907f002 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -95,10 +95,11 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi private fun initBookData() { booksLiveData?.removeObservers(this) booksLiveData = - if (groupId == -1) { - App.db.bookDao().observeAll() - } else { - App.db.bookDao().observeByGroup(groupId) + when (groupId) { + -1 -> App.db.bookDao().observeAll() + -2 -> App.db.bookDao().observeLocal() + -3 -> App.db.bookDao().observeAudio() + else -> App.db.bookDao().observeByGroup(groupId) } booksLiveData?.observe(this, Observer { adapter.selectedBooks.clear()