From 4eab3b92a092b659c7c98f4f51b762b03e18210d Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 18 Oct 2020 16:19:21 +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 --- .../io/legado/app/ui/book/cache/CacheActivity.kt | 12 ++---------- app/src/main/res/menu/download.xml | 16 +--------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt index 97a16813c..504c17f2f 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt @@ -95,16 +95,6 @@ class CacheActivity : VMBaseActivity(R.layout.activity_download) R.id.menu_log -> { TextListDialog.show(supportFragmentManager, getString(R.string.log), CacheBook.logs) } - R.id.menu_no_group -> { - title_bar.subtitle = getString(R.string.no_group) - groupId = AppConst.bookGroupNoneId - initBookData() - } - R.id.menu_all -> { - title_bar.subtitle = item.title - groupId = AppConst.bookGroupAllId - initBookData() - } else -> if (item.groupId == R.id.menu_group) { title_bar.subtitle = item.title groupId = App.db.bookGroupDao().getByName(item.title.toString())?.groupId ?: 0 @@ -124,6 +114,8 @@ class CacheActivity : VMBaseActivity(R.layout.activity_download) booksLiveData?.removeObservers(this) booksLiveData = when (groupId) { AppConst.bookGroupAllId -> App.db.bookDao().observeAll() + AppConst.bookGroupLocalId -> App.db.bookDao().observeLocal() + AppConst.bookGroupAudioId -> App.db.bookDao().observeAudio() AppConst.bookGroupNoneId -> App.db.bookDao().observeNoGroup() else -> App.db.bookDao().observeByGroup(groupId) } diff --git a/app/src/main/res/menu/download.xml b/app/src/main/res/menu/download.xml index 6303b5b9d..2f50268d9 100644 --- a/app/src/main/res/menu/download.xml +++ b/app/src/main/res/menu/download.xml @@ -14,21 +14,7 @@ android:id="@+id/menu_book_group" android:title="@string/group" android:icon="@drawable/ic_groups" - app:showAsAction="always"> - - - - - - - - - - + app:showAsAction="always" />