PreferenceInputNumber

fun <T : Number> PreferenceScope.PreferenceInputNumber(value: MutableState<T>, validator: DialogInputValidator = DialogInputNumber.rememberDefaultValidator(value.value), formatter: (value: T) -> String = { it.toString() }, title: String, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, subtitle: String? = null, icon: @Composable () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, itemSetup: PreferenceItemSetup = PreferenceInputNumberDefaults.itemSetup(), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), dialog: @Composable (state: DialogState) -> Unit = { dialogState -> PreferenceInputNumberDefaults.dialog(dialogState, value.value, { value.value = it }, validator, title, icon) })

A number input preference item - this item provides a input dialog to change this preference

 

Basic Parameters: all params not described here are derived from com.michaelflisar.composepreferences.core.composables.BasePreference, check it out for more details

Parameters

value

the MutableState of this item

validator

the DialogInputValidator of this item

formatter

the formatter of this item


fun <T : Number> PreferenceScope.PreferenceInputNumber(value: T, onValueChange: (value: T) -> Unit, validator: DialogInputValidator = DialogInputNumber.rememberDefaultValidator(value), formatter: (value: T) -> String = { it.toString() }, title: String, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, subtitle: String? = null, icon: @Composable () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, itemSetup: PreferenceItemSetup = PreferenceInputNumberDefaults.itemSetup(), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), dialog: @Composable (state: DialogState) -> Unit = { dialogState -> PreferenceInputNumberDefaults.dialog(dialogState, value, onValueChange, validator, title, icon) })

A number input preference item - this item provides a input dialog to change this preference

 

Basic Parameters: all params not described here are derived from com.michaelflisar.composepreferences.core.composables.BasePreference, check it out for more details

Parameters

value

the value of this item

onValueChange

the value changed callback of this item

validator

the DialogInputValidator of this item

formatter

the formatter of this item