summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
index a9d2ef6dc3f6..6e4fd78a039b 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
@@ -101,8 +101,8 @@ fun Spinner(options: List<SpinnerOption>, selectedId: Int?, setId: (id: Int) ->
Modifier.background(MaterialTheme.colorScheme.surfaceContainerLow)
.padding(horizontal = SettingsDimension.paddingSmall),
) {
- for ((index, option) in options.withIndex()) {
- val selected = index + 1 == selectedId
+ for (option in options) {
+ val selected = option.id == selectedId
DropdownMenuItem(
text = { SpinnerOptionText(option = option, selected) },
onClick = {