mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 11:17:48 +01:00
Fix crash in single-page chapters
This commit is contained in:
parent
1a52385b78
commit
675c0cefc3
1 changed files with 3 additions and 1 deletions
|
@ -84,6 +84,7 @@ 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
|
||||||
|
@ -729,7 +730,8 @@ 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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue