From 675c0cefc35814fb235f1aa07d1105d1fe3cda36 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 4 Oct 2021 11:06:23 -0400 Subject: [PATCH] Fix crash in single-page chapters --- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 4a49513f5e..88b6996084 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -84,6 +84,7 @@ import timber.log.Timber import uy.kohesive.injekt.injectLazy import java.io.File import kotlin.math.abs +import kotlin.math.max /** * Activity containing the reader of Tachiyomi. This activity is mostly a container of the @@ -729,7 +730,8 @@ class ReaderActivity : BaseRxActivity() } // 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() }