Open
Conversation
10 tasks
🟢 Netlify deploy for commit dd60bc1 succeededDeploy preview: https://69d8c9fb35399523a4af0350--ouds-android.netlify.app |
0039890 to
23d7bf0
Compare
core/src/main/java/com/orange/ouds/core/component/OudsBottomSheet.kt
Outdated
Show resolved
Hide resolved
core/src/main/java/com/orange/ouds/core/component/OudsBottomSheetScaffold.kt
Outdated
Show resolved
Hide resolved
| snackbarHost = snackbarHost, | ||
| containerColor = Color.Transparent, | ||
| contentColor = OudsTheme.colorScheme.content.default, | ||
| content = content |
Member
There was a problem hiding this comment.
A few remarks about the parameters:
sheetMaxWidthandsheetShapeuse default values thus do not need to be set.- I think containerColor could be exposed in our API, because if a user wants to add a background color, he will add a
Boxin the content anyway.
core/src/main/java/com/orange/ouds/core/component/OudsModalBottomSheet.kt
Show resolved
Hide resolved
| ) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { | ||
| OudsModalBottomSheet( | ||
| onDismissRequest = { }, | ||
| sheetState = rememberModalBottomSheetState() |
Member
There was a problem hiding this comment.
I found an issue in the Paparazzi GitHub repository about the modal bottom sheet snapshots. The fix is to set the initialValue of the sheetState to Expanded:
val density = LocalDensity.current
OudsModalBottomSheet(
onDismissRequest = { },
sheetState = remember {
SheetState(
skipPartiallyExpanded = true,
positionalThreshold = { with(density) { 56.dp.toPx() } },
velocityThreshold = { with(density) { 125.dp.toPx() } },
initialValue = SheetValue.Expanded,
)
},
) However the code is a bit verbose because the initialValue cannot be changed with rememberModalBottomSheetState and we must instantiate SheetState directly. As an alternative, this seems to work too:
val sheetState = rememberModalBottomSheetState()
LaunchedEffect(Unit) {
// This line is needed otherwise the modal bottom sheet is not displayed in snapshots
sheetState.expand()
}
OudsModalBottomSheet(
onDismissRequest = { },
sheetState = sheetState,
) {
Column(modifier = Modifier.padding(vertical = OudsTheme.spaces.fixed.medium, horizontal = OudsTheme.grids.margin)) {
Text(text = "Modal bottom sheet content.")
}
}But maybe the first solution is more robust because the second one calls expand() asynchronously.
...src/main/java/com/orange/ouds/app/ui/components/bottomsheet/BottomSheetScaffoldDemoScreen.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/orange/ouds/app/ui/components/bottomsheet/BottomSheetScaffoldDemoScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/orange/ouds/app/ui/components/bottomsheet/ModalBottomSheetDemoState.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/orange/ouds/app/ui/components/bottomsheet/ModalBottomSheetDemoScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/orange/ouds/app/ui/components/bottomsheet/ModalBottomSheetDemoScreen.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # core/src/main/res/values-ar/strings.xml # core/src/main/res/values-fr/strings.xml # core/src/main/res/values/strings.xml
…ith scroll in the screen
0aad1f0 to
f402fef
Compare
f402fef to
59144f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.