From a6937bd4345f7e72b285d2ca68e0f4f8a2493875 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 6 Apr 2020 21:20:43 +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/main/bookshelf/BookshelfFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 3e353cd20..fd065c307 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -120,7 +120,7 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b if (AppConfig.bookGroupAudioShow) { bookGroups.add(AppConst.bookGroupAudio) } - showGroupNone = if (App.db.bookDao().noGroupSize > 0) { + showGroupNone = if (App.db.bookDao().noGroupSize > 0 && it.isNotEmpty()) { bookGroups.add(AppConst.bookGroupNone) true } else { @@ -166,7 +166,8 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b bookGroups.remove(AppConst.bookGroupLocal) bookGroups.remove(AppConst.bookGroupAudio) bookGroups.remove(AppConst.bookGroupNone) - showGroupNone = if (App.db.bookDao().noGroupSize > 0) { + showGroupNone = + if (App.db.bookDao().noGroupSize > 0 && bookGroups.isNotEmpty()) { bookGroups.add(0, AppConst.bookGroupNone) true } else {