From 1f2fd8bd6442ca439b01bbdd231f534a017dac9b Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 22 Oct 2019 08:09:05 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 fa79dd965..2eae91a6c 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 @@ -193,9 +193,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { when (keyCode) { - KeyEvent.KEYCODE_BACK -> { - event?.startTracking() - } KeyEvent.KEYCODE_VOLUME_UP -> { if (volumeKeyPage(PageDelegate.Direction.PREV)) { return true @@ -234,7 +231,10 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } KeyEvent.KEYCODE_BACK -> { event?.let { - if ((event.flags and KeyEvent.FLAG_CANCELED_LONG_PRESS == 0)) { + if ((event.flags and KeyEvent.FLAG_CANCELED_LONG_PRESS == 0) + && event.isTracking + && !event.isCanceled + ) { if (readAloudStatus == Status.PLAY) { ReadAloud.pause(this) toast(R.string.read_aloud_pause)