horologist
horologist copied to clipboard
AnimatedPlayPauseProgressButton "flashes" when seeking forwards or backwards within the same file.
Horologist 0.5.6. This is due to the state resetting to "Loading" while the seek is in progress. This causes the progress to reset to 0.
Can be mitigated with the following code:
var trackPositionUiModel by remember { mutableStateOf(playerUiState.trackPositionUiModel) }
LaunchedEffect(playerUiState.trackPositionUiModel) {
when (val state = playerUiState.trackPositionUiModel) {
is TrackPositionUiModel.Actual -> trackPositionUiModel = state
TrackPositionUiModel.Hidden -> trackPositionUiModel = state
is TrackPositionUiModel.Loading -> {
/* Don't overwrite state -- avoids glitches when seeking. */
}
is TrackPositionUiModel.Predictive -> trackPositionUiModel = state
}
}
Since you have a workaround, we won't rush out a quick fix. Thanks for reporting.
Unlikely to be fixed with the current component based on priorities, happy to accept a PR, otherwise hopefully fixed with a next refresh.