|
|
@ -73,13 +73,12 @@ 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 |
|
|
|
view_pager_main.currentItem = 0 |
|
|
|
&& !event.isCanceled |
|
|
|
return true |
|
|
|
) { |
|
|
|
} |
|
|
|
view_pager_main.currentItem = 0 |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|