Skip to content

Commit

Permalink
refactor: use round extension function in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
anilbeesetti committed Aug 18, 2023
1 parent 9e18261 commit a5d349b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import dev.anilbeesetti.nextplayer.core.common.extensions.round
import dev.anilbeesetti.nextplayer.core.model.DoubleTapGesture
import dev.anilbeesetti.nextplayer.core.model.FastSeek
import dev.anilbeesetti.nextplayer.core.model.Resume
Expand Down Expand Up @@ -260,7 +261,7 @@ fun PlayerPreferencesScreen(
Slider(
value = defaultPlaybackSpeed,
onValueChange = {
defaultPlaybackSpeed = String.format("%.1f", it).toFloat()
defaultPlaybackSpeed = it.round(2)
},
valueRange = 0.2f..4.0f,
steps = 37
Expand Down

0 comments on commit a5d349b

Please sign in to comment.