mirror of
https://codeberg.org/mi6e4ka/openstore.git
synced 2026-07-10 00:12:06 +00:00
fix(ui): mini update platform selector code
This commit is contained in:
parent
1a0bbad813
commit
d258f892f7
1 changed files with 13 additions and 8 deletions
|
|
@ -76,6 +76,13 @@ fun ResultsScreen(
|
|||
}
|
||||
},
|
||||
actions = {
|
||||
val platforms = remember {
|
||||
listOf(
|
||||
Platform("Mobile", "mobile"),
|
||||
Platform("TV", "tv")
|
||||
)
|
||||
}
|
||||
|
||||
TextButton({platformSelectorExpanded = true}) {
|
||||
Text(state.selectedPlatform.label)
|
||||
}
|
||||
|
|
@ -83,14 +90,12 @@ fun ResultsScreen(
|
|||
expanded = platformSelectorExpanded,
|
||||
onDismissRequest = {platformSelectorExpanded = false}
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text("Mobile") },
|
||||
onClick = { viewModel.selectPlatform(Platform("Mobile", "mobile")); platformSelectorExpanded=false }
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("TV") },
|
||||
onClick = { viewModel.selectPlatform(Platform("TV", "tv")); platformSelectorExpanded=false }
|
||||
)
|
||||
platforms.forEach {
|
||||
DropdownMenuItem(
|
||||
text = { Text(it.label) },
|
||||
onClick = { viewModel.selectPlatform(it); platformSelectorExpanded=false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue