From 793d13e9dd74468d14de80f1e1bc04041f17a9d1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 22 Feb 2020 17:37:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=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 --- .../app/ui/book/read/ReadBookActivity.kt | 21 +++++++++++++++++++ 1 file 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 7f15d7de7..82978d03f 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 @@ -385,8 +385,14 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } + /** + * 当前选择的文本 + */ override val selectedText: String get() = page_view.curPage.selectedText + /** + * 文本选择菜单操作 + */ override fun onMenuItemSelected(item: MenuItemImpl): Boolean { when (item.itemId) { R.id.menu_replace -> ReplaceEditDialog @@ -395,6 +401,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo return false } + /** + * 文本选择菜单操作完成 + */ override fun onMenuActionFinally() { textActionMenu?.dismiss() page_view.pageDelegate?.isTextSelected = false @@ -431,12 +440,18 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } + /** + * 更新内容 + */ override fun upContent(position: Int) { launch { page_view.upContent(position) } } + /** + * 更新视图 + */ override fun upView() { launch { ReadBook.curTextChapter?.let { @@ -454,12 +469,18 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } + /** + * 更新进度条 + */ override fun upPageProgress() { launch { seek_read_page.progress = ReadBook.durPageIndex } } + /** + * 显示菜单 + */ override fun showMenuBar() { read_menu.runMenuIn() }