-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe0c90e
commit 9a36e0a
Showing
13 changed files
with
198 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
## Scaffold | ||
|
||
Blurring the content behind app bars is a common use case, so how can we use Haze with `Scaffold`? It's pretty much the same as above: | ||
|
||
!!! tip "Multiple hazeChilds" | ||
Note: We are using multiple `hazeChild`s in this example. You can actually use an abitrary number of `hazeChild`s. | ||
|
||
``` kotlin | ||
val hazeState = remember { HazeState() } | ||
|
||
Scaffold( | ||
topBar = { | ||
TopAppBar( | ||
// Need to make app bar transparent to see the content behind | ||
colors = TopAppBarDefaults.largeTopAppBarColors(Color.Transparent), | ||
modifier = Modifier | ||
.hazeChild(state = hazeState) | ||
.fillMaxWidth(), | ||
) { | ||
/* todo */ | ||
} | ||
}, | ||
bottomBar = { | ||
NavigationBar( | ||
containerColor = Color.Transparent, | ||
modifier = Modifier | ||
.hazeChild(state = hazeState) | ||
.fillMaxWidth(), | ||
) { | ||
/* todo */ | ||
} | ||
}, | ||
) { | ||
LazyVerticalGrid( | ||
modifier = Modifier | ||
.haze( | ||
state = hazeState, | ||
style = HazeDefaults.style(backgroundColor = MaterialTheme.colorScheme.surface), | ||
), | ||
) { | ||
// todo | ||
} | ||
} | ||
``` |
Oops, something went wrong.