mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Avoid crash when unknown reading mode is used
This commit is contained in:
parent
544adb9940
commit
b4577d6676
1 changed files with 8 additions and 4 deletions
|
@ -554,10 +554,14 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showReadingModeToast(mode: Int) {
|
private fun showReadingModeToast(mode: Int) {
|
||||||
val strings = resources.getStringArray(R.array.viewers_selector)
|
try {
|
||||||
readingModeToast?.cancel()
|
val strings = resources.getStringArray(R.array.viewers_selector)
|
||||||
readingModeToast = toast(strings[mode]) {
|
readingModeToast?.cancel()
|
||||||
it.setGravity(Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL, 0, 0)
|
readingModeToast = toast(strings[mode]) {
|
||||||
|
it.setGravity(Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL, 0, 0)
|
||||||
|
}
|
||||||
|
} catch (e: ArrayIndexOutOfBoundsException) {
|
||||||
|
Timber.e("Unknown reading mode: $mode")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue