Fix crash in single-page chapters
(cherry picked from commit 675c0cefc35814fb235f1aa07d1105d1fe3cda36) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
This commit is contained in:
parent
4ddaba06f7
commit
52f4e60d9b
@ -113,6 +113,8 @@ import timber.log.Timber
|
|||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity containing the reader of Tachiyomi. This activity is mostly a container of the
|
* Activity containing the reader of Tachiyomi. This activity is mostly a container of the
|
||||||
* viewers, to which calls from the presenter or UI events are delegated.
|
* viewers, to which calls from the presenter or UI events are delegated.
|
||||||
@ -1264,11 +1266,12 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set slider progress
|
// Set slider progress
|
||||||
binding.pageSlider.valueTo = pages.lastIndex.toFloat()
|
binding.pageSlider.isEnabled = pages.size > 1
|
||||||
|
binding.pageSlider.valueTo = max(pages.lastIndex.toFloat(), 1f)
|
||||||
binding.pageSlider.value = page.index.toFloat()
|
binding.pageSlider.value = page.index.toFloat()
|
||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
binding.pageSliderVert.valueTo = pages.lastIndex.toFloat()
|
binding.pageSliderVert.valueTo = max(pages.lastIndex.toFloat(), 1f)
|
||||||
binding.pageSliderVert.value = page.index.toFloat()
|
binding.pageSliderVert.value = page.index.toFloat()
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user