@@ -18,9 +18,12 @@ import androidx.compose.material.icons.Icons
1818import androidx.compose.material.icons.outlined.PlayArrow
1919import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
2020import androidx.compose.material3.Icon
21+ import androidx.compose.material3.ListItemDefaults
22+ import androidx.compose.material3.ListItemShapes
2123import androidx.compose.material3.MaterialShapes
2224import androidx.compose.material3.MaterialTheme
2325import androidx.compose.material3.Scaffold
26+ import androidx.compose.material3.SegmentedListItem
2427import androidx.compose.material3.SnackbarDuration
2528import androidx.compose.material3.SnackbarHost
2629import androidx.compose.material3.SnackbarHostState
@@ -31,16 +34,13 @@ import androidx.compose.runtime.Composable
3134import androidx.compose.runtime.Immutable
3235import androidx.compose.runtime.remember
3336import androidx.compose.ui.Modifier
34- import androidx.compose.ui.graphics.Shape
3537import androidx.compose.ui.unit.dp
3638import androidx.lifecycle.lifecycleScope
3739import com.edricchan.studybuddy.R
3840import com.edricchan.studybuddy.constants.MimeTypeConstants
3941import com.edricchan.studybuddy.exts.android.showToast
4042import com.edricchan.studybuddy.exts.androidx.compose.plus
4143import com.edricchan.studybuddy.ui.common.fragment.ComposableFragment
42- import com.edricchan.studybuddy.ui.widgets.compose.list.m3.ExpListItem
43- import com.edricchan.studybuddy.ui.widgets.compose.list.m3.ExpListItemDefaults
4444import com.edricchan.studybuddy.ui.widgets.modalbottomsheet.select.dsl.showMultiSelectBottomSheet
4545import com.edricchan.studybuddy.ui.widgets.modalbottomsheet.select.dsl.showSingleSelectBottomSheet
4646import com.edricchan.studybuddy.ui.widgets.modalbottomsheet.views.ModalBottomSheetAdapter
@@ -109,6 +109,7 @@ class DebugModalBottomSheetFragment : ComposableFragment() {
109109
110110 private val snackbarHostState = SnackbarHostState ()
111111
112+ @OptIn(ExperimentalMaterial3ExpressiveApi ::class )
112113 @Composable
113114 override fun Content (modifier : Modifier ) {
114115 val demos = rememberDemos()
@@ -121,11 +122,11 @@ class DebugModalBottomSheetFragment : ComposableFragment() {
121122 LazyColumn (
122123 modifier = Modifier .consumeWindowInsets(innerPadding),
123124 contentPadding = innerPadding + PaddingValues (horizontal = 16 .dp),
124- verticalArrangement = Arrangement .spacedBy(ExpListItemDefaults .groupedItemsSpacing )
125+ verticalArrangement = Arrangement .spacedBy(ListItemDefaults . SegmentedGap )
125126 ) {
126127 itemsIndexed(demos) { i, item ->
127128 DemoListItem (
128- shape = ExpListItemDefaults .itemShape (
129+ shapes = ListItemDefaults .segmentedShapes (
129130 index = i, count = demos.size
130131 ),
131132 iconRotationDeg = i * 15 ,
@@ -141,12 +142,12 @@ class DebugModalBottomSheetFragment : ComposableFragment() {
141142 @Composable
142143 private fun DemoListItem (
143144 modifier : Modifier = Modifier ,
144- shape : Shape ,
145+ shapes : ListItemShapes ,
145146 iconRotationDeg : Int ,
146147 title : String ,
147148 onClick : () -> Unit
148149 ) {
149- ExpListItem (
150+ SegmentedListItem (
150151 modifier = modifier,
151152 onClick = onClick,
152153 leadingContent = {
@@ -160,10 +161,14 @@ class DebugModalBottomSheetFragment : ComposableFragment() {
160161 )
161162 }
162163 },
163- headlineContent = {
164+ content = {
164165 Text (text = title)
165166 },
166- shape = shape
167+ colors = ListItemDefaults .segmentedColors(
168+ containerColor = MaterialTheme .colorScheme.surfaceContainer,
169+ contentColor = MaterialTheme .colorScheme.onSurface
170+ ),
171+ shapes = shapes
167172 )
168173 }
169174
0 commit comments