Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Oct 31, 2024
1 parent f39edf5 commit e833bfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 5 additions & 4 deletions docs/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,13 @@ Dialog(rememberDialogState()) {
val window = LocalModalWindow.current
LaunchedEffect(Unit) {
// change system bars to transparent
window.navigationBarColor = Color.Transparent.toArgb()
window.statusBarColor = Color.Transparent.toArgb()
window.navigationBarColor = Color.Transparent.toArgb()

// don't forget to update the icons too
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = true
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightNavigationBars = true
val windowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
windowInsetsControllerCompat.isAppearanceLightStatusBars = true
windowInsetsControllerCompat.isAppearanceLightNavigationBars = true
}
BasicText("Transparent bars. So cool 😎 ", modifier = Modifier.navigationBarsPadding())
}
Expand Down Expand Up @@ -320,7 +321,7 @@ from a `DialogScope`.
| `enter` | The `EnterTransition` when the Scrim enters the composition |
| `exit` | The `ExitTransition` when the Scrim enters the composition |

## Core Dialog vs Compose Dialog
## Compose Unstyled Dialog vs Compose Dialog

Compose Multiplatform's original Dialog component does not support custom animations. Even though it is possible to
animate it, it requires you to combine multiple components together and sync state to animations to composition which is
Expand Down
15 changes: 7 additions & 8 deletions docs/modal-bottom-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,24 +445,23 @@ ModalBottomSheet(state = sheetState) {

**Android only**

Modal bottom sheets will darken the navigation bar when displayed by default. This will work for most designs, but you
might need more customizations.

We provide a `LocalModalWindow` composition local, which provides you with the Android `Window` that hosts the modal
sheet, so that you can customize the System UI according to your needs:
ModalBottomSheet will not change the color of your system UI when displayed. We provide a `LocalModalWindow` composition local,
which provides you with the Android `Window` that hosts the dialog, so that you can customize the System UI according to
your needs:

```kotlin
ModalBottomSheet(rememberModalBottomSheetState(initialDetent = SheetDetent.FullyExpanded)) {
Sheet(Modifier.fillMaxWidth()) {
val window = LocalModalWindow.current
LaunchedEffect(Unit) {
// change system bars to transparent
window.navigationBarColor = Color.Transparent.toArgb()
window.statusBarColor = Color.Transparent.toArgb()
window.navigationBarColor = Color.Black.copy(0.3f).toArgb()

// don't forget to update the icons too
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = true
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightNavigationBars = true
val windowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
windowInsetsController.isAppearanceLightStatusBars = true
windowInsetsController.isAppearanceLightNavigationBars = false
}
BasicText("Transparent bars. So cool 😎 ", modifier = Modifier.navigationBarsPadding())
}
Expand Down

0 comments on commit e833bfc

Please sign in to comment.