mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-10 19:13:19 +02:00
A few more crashes fixed
This commit is contained in:
parent
4196a0f585
commit
fe49286d97
@ -143,6 +143,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
|
if (isFinishing) return
|
||||||
|
|
||||||
presenter.onChapterLeft()
|
presenter.onChapterLeft()
|
||||||
|
|
||||||
val chapterToUpdate = presenter.getMangaSyncChapterToUpdate()
|
val chapterToUpdate = presenter.getMangaSyncChapterToUpdate()
|
||||||
@ -173,26 +175,28 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||||
val action = event.action
|
if (!isFinishing) {
|
||||||
val keyCode = event.keyCode
|
val action = event.action
|
||||||
when (keyCode) {
|
val keyCode = event.keyCode
|
||||||
KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT -> {
|
when (keyCode) {
|
||||||
if (action == KeyEvent.ACTION_UP)
|
KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT -> {
|
||||||
viewer?.moveToNext()
|
if (action == KeyEvent.ACTION_UP)
|
||||||
return true
|
viewer?.moveToNext()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_DPAD_LEFT -> {
|
||||||
|
if (action == KeyEvent.ACTION_UP)
|
||||||
|
viewer?.moveToPrevious()
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_DPAD_LEFT -> {
|
|
||||||
if (action == KeyEvent.ACTION_UP)
|
|
||||||
viewer?.moveToPrevious()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
else -> return super.dispatchKeyEvent(event)
|
|
||||||
}
|
}
|
||||||
|
return super.dispatchKeyEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onChapterError(error: Throwable) {
|
fun onChapterError(error: Throwable) {
|
||||||
finish()
|
|
||||||
Timber.e(error, error.message)
|
Timber.e(error, error.message)
|
||||||
|
finish()
|
||||||
toast(R.string.page_list_error)
|
toast(R.string.page_list_error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user