@@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1818import androidx.compose.foundation.layout.navigationBars
1919import androidx.compose.foundation.layout.padding
2020import androidx.compose.foundation.layout.width
21+ import androidx.compose.foundation.lazy.LazyColumn
2122import androidx.compose.runtime.Composable
2223import androidx.compose.runtime.MutableState
2324import androidx.compose.runtime.getValue
@@ -507,48 +508,52 @@ fun BottomSheet(
507508 }
508509 }
509510 ) {
510- var progress by remember { mutableStateOf(0.5f ) }
511- Slider (
512- progress = progress,
513- onProgressChange = { newProgress -> progress = newProgress },
514- decimalPlaces = 3 ,
515- modifier = Modifier .padding(bottom = 12 .dp)
516- )
517- Card (
518- modifier = Modifier .padding(bottom = 12 .dp),
519- colors = CardDefaults .defaultColors(
520- color = MiuixTheme .colorScheme.secondaryContainer,
521- )
522- ) {
523- SuperDropdown (
524- title = " Dropdown" ,
525- items = dropdownOptions,
526- selectedIndex = bottomSheetDropdownSelectedOption.value,
527- onSelectedIndexChange = { newOption -> bottomSheetDropdownSelectedOption.value = newOption }
528- )
529- SuperSwitch (
530- title = " Switch" ,
531- checked = bottomSheetSuperSwitchState.value,
532- onCheckedChange = {
533- bottomSheetSuperSwitchState.value = it
511+ LazyColumn {
512+ item {
513+ var progress by remember { mutableStateOf(0.5f ) }
514+ Slider (
515+ progress = progress,
516+ onProgressChange = { newProgress -> progress = newProgress },
517+ decimalPlaces = 3 ,
518+ modifier = Modifier .padding(bottom = 12 .dp)
519+ )
520+ Card (
521+ modifier = Modifier .padding(bottom = 12 .dp),
522+ colors = CardDefaults .defaultColors(
523+ color = MiuixTheme .colorScheme.secondaryContainer,
524+ )
525+ ) {
526+ SuperDropdown (
527+ title = " Dropdown" ,
528+ items = dropdownOptions,
529+ selectedIndex = bottomSheetDropdownSelectedOption.value,
530+ onSelectedIndexChange = { newOption -> bottomSheetDropdownSelectedOption.value = newOption }
531+ )
532+ SuperSwitch (
533+ title = " Switch" ,
534+ checked = bottomSheetSuperSwitchState.value,
535+ onCheckedChange = {
536+ bottomSheetSuperSwitchState.value = it
537+ }
538+ )
534539 }
535- )
536- }
537- AnimatedVisibility (
538- visible = bottomSheetSuperSwitchState.value,
539- enter = fadeIn() + expandVertically(),
540- exit = fadeOut() + shrinkVertically()
541- ) {
542- val miuixColor = MiuixTheme .colorScheme.primary
543- var selectedColor by remember { mutableStateOf(miuixColor) }
544- ColorPalette (
545- modifier = Modifier .padding(bottom = 12 .dp),
546- initialColor = selectedColor,
547- onColorChanged = { selectedColor = it },
548- showPreview = false
549- )
540+ AnimatedVisibility (
541+ visible = bottomSheetSuperSwitchState.value,
542+ enter = fadeIn() + expandVertically(),
543+ exit = fadeOut() + shrinkVertically()
544+ ) {
545+ val miuixColor = MiuixTheme .colorScheme.primary
546+ var selectedColor by remember { mutableStateOf(miuixColor) }
547+ ColorPalette (
548+ modifier = Modifier .padding(bottom = 12 .dp),
549+ initialColor = selectedColor,
550+ onColorChanged = { selectedColor = it },
551+ showPreview = false
552+ )
553+ }
554+ Spacer (Modifier .padding(bottom = WindowInsets .navigationBars.asPaddingValues().calculateBottomPadding()))
555+ }
550556 }
551- Spacer (Modifier .padding(bottom = WindowInsets .navigationBars.asPaddingValues().calculateBottomPadding()))
552557 }
553558}
554559
0 commit comments