Skip to content

SimpleDropDownPreference

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

Equivalent of the DropDownPreference xml tag.

Usage

In your code:

SimpleSettings(this).show {
	TextPref {
		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">
	
	<DropDownPreference
    	app:key="key"
    	app:title="Title"
    	app:entries="@array/fruits"
        app:entryValues="@array/fruits_values"
        app:defaultValue="3"
        app:useSimpleSummaryProvider="true"
		... />

</PreferenceScreen>