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