@@ -10,6 +10,8 @@ import android.content.res.Configuration
1010import androidx.compose.foundation.clickable
1111import androidx.compose.foundation.isSystemInDarkTheme
1212import androidx.compose.foundation.layout.Column
13+ import androidx.compose.foundation.rememberScrollState
14+ import androidx.compose.foundation.verticalScroll
1315import androidx.compose.foundation.layout.Row
1416import androidx.compose.foundation.layout.Spacer
1517import androidx.compose.foundation.layout.fillMaxWidth
@@ -20,7 +22,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api
2022import androidx.compose.material3.Icon
2123import androidx.compose.material3.MaterialTheme
2224import androidx.compose.material3.ModalBottomSheet
23- import androidx.compose.material3.Surface
2425import androidx.compose.material3.Text
2526import androidx.compose.material3.darkColorScheme
2627import androidx.compose.material3.lightColorScheme
@@ -60,7 +61,7 @@ fun ScopeBottomSheetContent(
6061 showPrivate : Boolean = true,
6162 onScopeSelected : (Scope ) -> Unit
6263) {
63- Column (modifier = modifier.fillMaxWidth().padding(bottom = 8 .dp)) {
64+ Column (modifier = modifier.fillMaxWidth().verticalScroll(rememberScrollState()). padding(bottom = 8 .dp)) {
6465 if (showPrivate) {
6566 ScopeOption (
6667 iconRes = R .drawable.ic_cellphone,
@@ -128,23 +129,18 @@ private fun ScopeOption(
128129 }
129130}
130131
131- @Preview(name = " Light" , showBackground = true )
132- @Preview(name = " Dark" , showBackground = true , uiMode = Configuration .UI_MODE_NIGHT_YES )
132+ @OptIn(ExperimentalMaterial3Api ::class )
133+ @Preview(name = " Light" )
134+ @Preview(name = " Dark" , uiMode = Configuration .UI_MODE_NIGHT_YES )
135+ @Preview(name = " RTL · Arabic" , locale = " ar" )
133136@Composable
134137private fun PreviewScopeBottomSheet () {
135138 val colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
136139 MaterialTheme (colorScheme = colorScheme) {
137- Surface {
138- ScopeBottomSheetContent (onScopeSelected = {})
139- }
140- }
141- }
142-
143- @Preview(name = " RTL · Arabic" , showBackground = true , locale = " ar" )
144- @Composable
145- private fun PreviewScopeBottomSheetRtl () {
146- MaterialTheme (colorScheme = lightColorScheme()) {
147- Surface {
140+ ModalBottomSheet (
141+ onDismissRequest = {},
142+ sheetState = rememberModalBottomSheetState()
143+ ) {
148144 ScopeBottomSheetContent (onScopeSelected = {})
149145 }
150146 }
0 commit comments