From 528b0ac45b0209a3c6367e7a17b574bbc7cbd079 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 17 May 2020 19:07:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 886f7938f..f2830dc52 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 @@ -346,6 +346,10 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo toast(R.string.read_aloud_pause) return true } + if (isAutoPage) { + autoPageStop() + return true + } } } } @@ -561,9 +565,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo */ override fun autoPage() { if (isAutoPage) { - isAutoPage = false - mHandler.removeCallbacks(autoPageRunnable) - page_view.upContent() + autoPageStop() } else { isAutoPage = true autoPagePlus() @@ -571,6 +573,12 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo read_menu.setAutoPage(isAutoPage) } + private fun autoPageStop() { + isAutoPage = false + mHandler.removeCallbacks(autoPageRunnable) + page_view.upContent() + } + private fun autoPagePlus() { mHandler.removeCallbacks(autoPageRunnable) autoPageProgress++