-
-
Notifications
You must be signed in to change notification settings - Fork 9
SimpleListPreference
Marc Auberer edited this page Jan 17, 2021
·
4 revisions
Equivalent of the ListPreference
xml tag.
In your code:
SimpleSettings(this).show {
ListPref {
title = "Title"
simpleSummaryProvider = true
entries = listOf("Apple", "Banana", "Avocado", "Pineapple")
defaultIndex = 2
...
}
}
In a seperate xml file:
<PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="key"
app:title="Title"
app:entries="@array/fruits"
app:entryValues="@array/fruits_values"
app:defaultValue="2"
app:useSimpleSummaryProvider="true"
... />
</PreferenceScreen>
© Marc Auberer 2020-2023