pull/783/head
gedoor 4 years ago
parent 9f1fdf048c
commit 829f4dc164
  1. 16
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 5
      app/src/main/res/menu/book_read.xml

@ -21,6 +21,7 @@ import io.legado.app.constant.Status
import io.legado.app.data.entities.Book import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookChapter
import io.legado.app.data.entities.BookProgress 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.ReadBookConfig
import io.legado.app.help.ReadTipConfig import io.legado.app.help.ReadTipConfig
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
@ -204,6 +205,21 @@ class ReadBookActivity : ReadBookBaseActivity(),
} }
} }
R.id.menu_download -> showDownloadDialog() 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 -> R.id.menu_copy_text ->
TextDialog.show(supportFragmentManager, ReadBook.curTextChapter?.getContent()) TextDialog.show(supportFragmentManager, ReadBook.curTextChapter?.getContent())
R.id.menu_update_toc -> ReadBook.book?.let { R.id.menu_update_toc -> ReadBook.book?.let {

@ -44,6 +44,11 @@
</group> </group>
<item
android:id="@+id/menu_add_bookmark"
android:title="@string/bookmark_add"
app:showAsAction="never" />
<group android:id="@+id/menu_group_login"> <group android:id="@+id/menu_group_login">
<item <item
android:id="@+id/menu_login" android:id="@+id/menu_login"

Loading…
Cancel
Save