Skip to content

Commit

Permalink
refactor: remove steps in sliders in compose
Browse files Browse the repository at this point in the history
  • Loading branch information
anilbeesetti committed Aug 19, 2023
1 parent a5d349b commit 4847d89
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import dev.anilbeesetti.nextplayer.core.ui.designsystem.NextIcons
import dev.anilbeesetti.nextplayer.settings.composables.OptionsDialog
import dev.anilbeesetti.nextplayer.settings.composables.PreferenceSubtitle
import dev.anilbeesetti.nextplayer.settings.extensions.name
import java.lang.Exception
import java.util.Locale

@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -260,11 +259,8 @@ fun PlayerPreferencesScreen(
)
Slider(
value = defaultPlaybackSpeed,
onValueChange = {
defaultPlaybackSpeed = it.round(2)
},
valueRange = 0.2f..4.0f,
steps = 37
onValueChange = { defaultPlaybackSpeed = it.round(1) },
valueRange = 0.2f..4.0f
)
}
)
Expand Down Expand Up @@ -294,8 +290,7 @@ fun PlayerPreferencesScreen(
Slider(
value = controllerAutoHideSec.toFloat(),
onValueChange = { controllerAutoHideSec = it.toInt() },
valueRange = 1.0f..60.0f,
steps = 60
valueRange = 1.0f..60.0f
)
}
)
Expand Down Expand Up @@ -325,8 +320,7 @@ fun PlayerPreferencesScreen(
Slider(
value = seekIncrement.toFloat(),
onValueChange = { seekIncrement = it.toInt() },
valueRange = 1.0f..60.0f,
steps = 60
valueRange = 1.0f..60.0f
)
}
)
Expand Down Expand Up @@ -438,7 +432,9 @@ fun LazyListScope.autoplaySetting(
isChecked = isChecked,
onClick = onClick
)
} fun LazyListScope.rememberBrightnessSetting(
}

fun LazyListScope.rememberBrightnessSetting(
isChecked: Boolean,
onClick: () -> Unit
) = item {
Expand Down

0 comments on commit 4847d89

Please sign in to comment.