|
|
|
@ -73,14 +73,13 @@ class MainActivity : VMBaseActivity<MainViewModel>(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 |
|
|
|
|
) { |
|
|
|
|
KeyEvent.KEYCODE_BACK -> if (event.isTracking && !event.isCanceled) { |
|
|
|
|
if (pagePosition != 0) { |
|
|
|
|
view_pager_main.currentItem = 0 |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return super.onKeyUp(keyCode, event) |
|
|
|
|