Fix reader navigator slider steps not updating after changing chapter (#3549)
This commit is contained in:
@@ -32,6 +32,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
||||
- Fix support for non-system SAF providers ([@AntsyLich](https://github.com/AntsyLich)) ([#3530](https://github.com/mihonapp/mihon/pull/3530))
|
||||
- Fix chapter's `memo` field not being updated for existing chapters ([@cuong-tran](https://github.com/cuong-tran)) ([#3538](https://github.com/mihonapp/mihon/pull/3538))
|
||||
- Fix app not reading `tachiyomix.extensionLib` extension metadata ([@AntsyLich](https://github.com/AntsyLich)) ([#3545](https://github.com/mihonapp/mihon/pull/3545))
|
||||
- Fix reader navigator slider steps not updating after changing chapter ([@AntsyLich](https://github.com/AntsyLich)) ([#3549](https://github.com/mihonapp/mihon/pull/3549))
|
||||
|
||||
## [v0.20.0] - 2026-06-27
|
||||
### Added
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.compose.material3.Slider
|
||||
import androidx.compose.material3.SliderState
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.VerticalSlider
|
||||
import androidx.compose.material3.rememberSliderState
|
||||
import androidx.compose.material3.surfaceColorAtElevation
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
@@ -74,11 +73,13 @@ fun ChapterNavigator(
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
val state = rememberSliderState(
|
||||
val state = remember(totalPages) {
|
||||
SliderState(
|
||||
value = currentPage.toFloat(),
|
||||
steps = totalPages - 2,
|
||||
valueRange = 1f..totalPages.toFloat(),
|
||||
)
|
||||
}
|
||||
state.value = currentPage.toFloat()
|
||||
state.onValueChange = { onPageIndexChange(it.roundToInt() - 1) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user