mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 06:29:17 +01:00
Fixed crash when using a reader mode from main tachi
The else case will default to R2L reader when the index is out of range
This commit is contained in:
parent
c438236bf7
commit
784bd22989
@ -832,11 +832,11 @@ class ReaderActivity :
|
|||||||
val noDefault = manga.viewer == -1
|
val noDefault = manga.viewer == -1
|
||||||
val mangaViewer = presenter.getMangaViewer()
|
val mangaViewer = presenter.getMangaViewer()
|
||||||
val newViewer = when (mangaViewer) {
|
val newViewer = when (mangaViewer) {
|
||||||
RIGHT_TO_LEFT -> R2LPagerViewer(this)
|
LEFT_TO_RIGHT -> L2RPagerViewer(this)
|
||||||
VERTICAL -> VerticalPagerViewer(this)
|
VERTICAL -> VerticalPagerViewer(this)
|
||||||
WEBTOON -> WebtoonViewer(this)
|
WEBTOON -> WebtoonViewer(this)
|
||||||
VERTICAL_PLUS -> WebtoonViewer(this, hasMargins = true)
|
VERTICAL_PLUS -> WebtoonViewer(this, hasMargins = true)
|
||||||
else -> L2RPagerViewer(this)
|
else -> R2LPagerViewer(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noDefault && presenter.manga?.viewer!! > 0) {
|
if (noDefault && presenter.manga?.viewer!! > 0) {
|
||||||
|
@ -102,15 +102,19 @@ class MaterialSpinnerView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setSelection(selection: Int) {
|
fun setSelection(selection: Int) {
|
||||||
|
if (selectedPosition >= 0 && selectedPosition < popup?.menu?.size() ?: 0) {
|
||||||
popup?.menu?.get(selectedPosition)?.let {
|
popup?.menu?.get(selectedPosition)?.let {
|
||||||
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||||
it.title = entries[selectedPosition]
|
it.title = entries[selectedPosition]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
selectedPosition = selection
|
selectedPosition = selection
|
||||||
|
if (selectedPosition >= 0 && selectedPosition < popup?.menu?.size() ?: 0) {
|
||||||
popup?.menu?.get(selectedPosition)?.let {
|
popup?.menu?.get(selectedPosition)?.let {
|
||||||
it.icon = tintedCheck()
|
it.icon = tintedCheck()
|
||||||
it.title = it.title?.tintText(blendedAccent)
|
it.title = it.title?.tintText(blendedAccent)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
binding.detailView.text = entries.getOrNull(selection).orEmpty()
|
binding.detailView.text = entries.getOrNull(selection).orEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user