From 829f4dc164673d41f195714bfff29060f853e4ef Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 30 Dec 2020 20:51:27 +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 --- .../legado/app/ui/book/read/ReadBookActivity.kt | 16 ++++++++++++++++ app/src/main/res/menu/book_read.xml | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index f2cd19baa..926bc8d1e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -21,6 +21,7 @@ import io.legado.app.constant.Status import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookProgress +import io.legado.app.data.entities.Bookmark import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadTipConfig import io.legado.app.help.storage.Backup @@ -204,6 +205,21 @@ class ReadBookActivity : ReadBookBaseActivity(), } } R.id.menu_download -> showDownloadDialog() + R.id.menu_add_bookmark -> { + val book = ReadBook.book + val page = ReadBook.curTextChapter?.page(ReadBook.durPageIndex()) + if (book != null && page != null) { + val bookmark = Bookmark( + bookUrl = book.bookUrl, + bookName = book.name, + chapterIndex = ReadBook.durChapterIndex, + chapterPos = ReadBook.durChapterPos, + chapterName = page.title, + bookText = page.text + ) + showBookMark(bookmark) + } + } R.id.menu_copy_text -> TextDialog.show(supportFragmentManager, ReadBook.curTextChapter?.getContent()) R.id.menu_update_toc -> ReadBook.book?.let { diff --git a/app/src/main/res/menu/book_read.xml b/app/src/main/res/menu/book_read.xml index d7bb23caf..f35b5b901 100644 --- a/app/src/main/res/menu/book_read.xml +++ b/app/src/main/res/menu/book_read.xml @@ -44,6 +44,11 @@ + +