Skip to content

SimpleMSListPreference

Marc Auberer edited this page Jan 17, 2021 · 2 revisions

Equivalent of the MultiSelectListPreference xml tag.

Usage

In your code:

SimpleSettings(this).show {
	MSListPref {
		title = "Title"
		simpleSummaryProvider = true
        entries = listOf("Apple", "Banana", "Avocado", "Pineapple")
		...
	}
}

In a seperate xml file:

<PreferenceScreen
    xmlns:app="http://schemas.android.com/apk/res-auto">
	
	<MultiSelectListPreference
    	app:key="key"
    	app:title="Title"
    	app:summary="Summary"
		app:entries="@array/fruits"
        app:entryValues="@array/fruits_values"
        app:defaultValue="@array/fruits_default_values"
		... />

</PreferenceScreen>