|
|
|
@ -239,6 +239,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo |
|
|
|
|
return super.onKeyDown(keyCode, event) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 长按事件 |
|
|
|
|
*/ |
|
|
|
|
override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean { |
|
|
|
|
when (keyCode) { |
|
|
|
|
KeyEvent.KEYCODE_BACK -> { |
|
|
|
@ -249,6 +252,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo |
|
|
|
|
return super.onKeyLongPress(keyCode, event) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 松开按键事件 |
|
|
|
|
*/ |
|
|
|
|
override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { |
|
|
|
|
when (keyCode) { |
|
|
|
|
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN -> { |
|
|
|
@ -274,6 +280,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo |
|
|
|
|
return super.onKeyUp(keyCode, event) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 音量键翻页 |
|
|
|
|
*/ |
|
|
|
|
private fun volumeKeyPage(direction: PageDelegate.Direction): Boolean { |
|
|
|
|
if (!read_menu.isVisible) { |
|
|
|
|
if (getPrefBoolean("volumeKeyPage", true)) { |
|
|
|
|