From 64c6fa6de14651d324bd2cda232e025abd04c27e Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 2 Jan 2023 18:55:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=BF=E6=8C=89=E5=88=86=E7=BB=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=BC=96=E8=BE=91=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bookshelf/style1/BookshelfFragment1.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/BookshelfFragment1.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/BookshelfFragment1.kt index afd72e992..1ebb01717 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/BookshelfFragment1.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/BookshelfFragment1.kt @@ -19,14 +19,18 @@ import io.legado.app.data.entities.BookGroup import io.legado.app.databinding.FragmentBookshelfBinding import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.primaryColor +import io.legado.app.ui.book.group.GroupEditDialog import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment import io.legado.app.ui.main.bookshelf.style1.books.BooksFragment -import io.legado.app.utils.getPrefInt -import io.legado.app.utils.putPrefInt -import io.legado.app.utils.setEdgeEffectColor -import io.legado.app.utils.toastOnUi +import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding +import kotlin.collections.List +import kotlin.collections.emptyList +import kotlin.collections.getOrNull +import kotlin.collections.hashMapOf +import kotlin.collections.mutableListOf +import kotlin.collections.set /** * 书架界面 @@ -88,6 +92,12 @@ class BookshelfFragment1 : BaseBookshelfFragment(R.layout.fragment_bookshelf), bookGroups.addAll(data) adapter.notifyDataSetChanged() selectLastTab() + for (i in 0 until adapter.count) { + tabLayout.getTabAt(i)?.view?.setOnLongClickListener { + showDialogFragment(GroupEditDialog(bookGroups[i])) + true + } + } } } }