fun <T> PreferenceScope.PreferenceList(style: PreferenceList.Style = PreferenceList.Style.Dialog(), value: MutableState<T>, items: List<T>, itemTextProvider: @Composable (item: T) -> String = { it.toString() }, itemIconProvider: @Composable (item: T) -> Unit? = null, filter: (filter: String, item: T) -> Boolean? = null, 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 = PreferenceListDefaults.itemSetup(style), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), dialog: @Composable (state: DialogState) -> Unit = { dialogState ->
PreferenceListDefaults.dialog(
style,
dialogState,
value.value,
{ value.value = it },
items,
itemTextProvider,
itemIconProvider,
title,
icon,
filter?.let {
DialogList.Filter(
filter = it,
keepSelectionForInvisibleItems = false
)
}
)
}) A list preference item - this item provides a list dialog or a dropdown 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
the list of items that this preference can select from
a converter to get the text of an item
a converter to provide an icon for an item
fun <T> PreferenceScope.PreferenceList(style: PreferenceList.Style = PreferenceList.Style.Dialog(), value: T, onValueChange: (value: T) -> Unit, items: List<T>, itemTextProvider: @Composable (item: T) -> String = { it.toString() }, itemIconProvider: @Composable (item: T) -> Unit? = null, 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 = PreferenceListDefaults.itemSetup(style), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), dialog: @Composable (state: DialogState) -> Unit = { dialogState ->
PreferenceListDefaults.dialog(
style,
dialogState,
value,
onValueChange,
items,
itemTextProvider,
itemIconProvider,
title,
icon
)
}) A list preference item - this item provides a list dialog or a dropdown 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
the value changed callback of this item
the list of items that this preference can select from
a converter to get the text of an item
a converter to provide an icon for an item