From 9ce3d146d998e930b6117b55f0d8c8c12be62870 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 30 Nov 2019 12:16:14 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/main/MainActivity.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 022aa2b53..7b8b0a14c 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -73,13 +73,12 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { event?.let { when (keyCode) { - KeyEvent.KEYCODE_BACK -> if ( - pagePosition != 0 - && event.isTracking - && !event.isCanceled - ) { - view_pager_main.currentItem = 0 - return true + KeyEvent.KEYCODE_BACK -> if (event.isTracking && !event.isCanceled) { + if (pagePosition != 0) { + view_pager_main.currentItem = 0 + return true + } + } } }