From 3bcef6fe9d59bb6fc156116d63f16e69bab7717e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 20 Mar 2022 10:38:24 +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 --- .../java/io/legado/app/ui/book/toc/ChapterListAdapter.kt | 7 +++++++ app/src/main/res/layout/item_chapter_list.xml | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt index c2f6dfc56..c6318f016 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt @@ -16,6 +16,7 @@ import io.legado.app.lib.theme.ThemeUtils import io.legado.app.lib.theme.accentColor import io.legado.app.utils.getCompatColor import io.legado.app.utils.gone +import io.legado.app.utils.longToastOnUi import io.legado.app.utils.visible import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.isActive @@ -145,6 +146,12 @@ class ChapterListAdapter(context: Context, val callback: Callback) : callback.openChapter(it) } } + holder.itemView.setOnLongClickListener { + getItem(holder.layoutPosition)?.let { + context.longToastOnUi(getDisplayTile(it)) + } + true + } } private fun upHasCache(binding: ItemChapterListBinding, isDur: Boolean, cached: Boolean) = diff --git a/app/src/main/res/layout/item_chapter_list.xml b/app/src/main/res/layout/item_chapter_list.xml index f80e52edc..0729a83da 100644 --- a/app/src/main/res/layout/item_chapter_list.xml +++ b/app/src/main/res/layout/item_chapter_list.xml @@ -13,7 +13,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:singleLine="true" - android:ellipsize="marquee" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@+id/iv_checked"