mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 15:41:52 +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 mangaViewer = presenter.getMangaViewer()
|
||||
val newViewer = when (mangaViewer) {
|
||||
RIGHT_TO_LEFT -> R2LPagerViewer(this)
|
||||
LEFT_TO_RIGHT -> L2RPagerViewer(this)
|
||||
VERTICAL -> VerticalPagerViewer(this)
|
||||
WEBTOON -> WebtoonViewer(this)
|
||||
VERTICAL_PLUS -> WebtoonViewer(this, hasMargins = true)
|
||||
else -> L2RPagerViewer(this)
|
||||
else -> R2LPagerViewer(this)
|
||||
}
|
||||
|
||||
if (noDefault && presenter.manga?.viewer!! > 0) {
|
||||
|
@ -102,14 +102,18 @@ class MaterialSpinnerView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
}
|
||||
|
||||
fun setSelection(selection: Int) {
|
||||
popup?.menu?.get(selectedPosition)?.let {
|
||||
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||
it.title = entries[selectedPosition]
|
||||
if (selectedPosition >= 0 && selectedPosition < popup?.menu?.size() ?: 0) {
|
||||
popup?.menu?.get(selectedPosition)?.let {
|
||||
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||
it.title = entries[selectedPosition]
|
||||
}
|
||||
}
|
||||
selectedPosition = selection
|
||||
popup?.menu?.get(selectedPosition)?.let {
|
||||
it.icon = tintedCheck()
|
||||
it.title = it.title?.tintText(blendedAccent)
|
||||
if (selectedPosition >= 0 && selectedPosition < popup?.menu?.size() ?: 0) {
|
||||
popup?.menu?.get(selectedPosition)?.let {
|
||||
it.icon = tintedCheck()
|
||||
it.title = it.title?.tintText(blendedAccent)
|
||||
}
|
||||
}
|
||||
binding.detailView.text = entries.getOrNull(selection).orEmpty()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user