From ade80d3f34b4eed4a1a2bc059bf9a1b751385e3e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 30 Nov 2019 18:14:19 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/service/BaseReadAloudService.kt | 4 ++++ .../main/java/io/legado/app/ui/book/read/ReadBookActivity.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt index 314d9d2d5..c4356ae72 100644 --- a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt @@ -37,6 +37,10 @@ abstract class BaseReadAloudService : BaseService(), var isRun = false var timeMinute: Int = 0 var pause = false + + fun isPlay(): Boolean { + return isRun && !pause + } } private val handler = Handler() 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 5c542a70f..921d57aff 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 @@ -214,7 +214,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo && event.isTracking && !event.isCanceled ) { - if (!BaseReadAloudService.pause) { + if (BaseReadAloudService.isPlay()) { ReadAloud.pause(this) toast(R.string.read_aloud_pause) return true