From 57fb85036dcb3b01957ca6c8677d32b2b27d2383 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 19 Dec 2020 09:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=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/read/ReadBookBaseActivity.kt | 2 +- .../java/io/legado/app/ui/book/toc/BookmarkAdapter.kt | 1 + .../java/io/legado/app/ui/book/toc/ChapterListFragment.kt | 3 ++- app/src/main/res/layout/item_bookmark.xml | 8 ++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt index a3b309dea..56165f6ee 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt @@ -206,7 +206,7 @@ abstract class ReadBookBaseActivity : val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply { editView.setHint(R.string.note_content) } - message = book.name + " • " + textChapter.title + message = bookmark.bookText customView = alertBinding.root yesButton { alertBinding.editView.text?.toString()?.let { editContent -> diff --git a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt index d733ca958..914414a60 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt @@ -44,6 +44,7 @@ class BookmarkAdapter(val callback: Callback) : PagedListAdapter(R.layout.fragment_chapter_list), ChapterListAdapter.Callback, @@ -134,7 +135,7 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme get() = viewModel.book?.isLocalBook() == true override fun durChapterIndex(): Int { - return durChapterIndex + return min(durChapterIndex, adapter.itemCount) } override fun openChapter(bookChapter: BookChapter) { diff --git a/app/src/main/res/layout/item_bookmark.xml b/app/src/main/res/layout/item_bookmark.xml index 971d56416..362acff10 100644 --- a/app/src/main/res/layout/item_bookmark.xml +++ b/app/src/main/res/layout/item_bookmark.xml @@ -13,6 +13,14 @@ android:padding="4dp" android:singleLine="true" /> + +