pull/49/head
kunfei 5 years ago
parent 0e667d867f
commit 9ce3d146d9
  1. 9
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -73,14 +73,13 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
event?.let { event?.let {
when (keyCode) { when (keyCode) {
KeyEvent.KEYCODE_BACK -> if ( KeyEvent.KEYCODE_BACK -> if (event.isTracking && !event.isCanceled) {
pagePosition != 0 if (pagePosition != 0) {
&& event.isTracking
&& !event.isCanceled
) {
view_pager_main.currentItem = 0 view_pager_main.currentItem = 0
return true return true
} }
}
} }
} }
return super.onKeyUp(keyCode, event) return super.onKeyUp(keyCode, event)

Loading…
Cancel
Save