mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
style(AppBar): Scrolled container color
This commit is contained in:
parent
1cc8abb599
commit
60ef9482c8
1 changed files with 6 additions and 6 deletions
|
@ -44,7 +44,7 @@ fun YokaiScaffold(
|
|||
) {
|
||||
val view = LocalView.current
|
||||
val useDarkIcons = MaterialTheme.colorScheme.surface.luminance() > .5
|
||||
val color = getTopAppBarColor(title)
|
||||
val (color, scrolledColor) = getTopAppBarColor(title)
|
||||
|
||||
SideEffect {
|
||||
val activity = view.context as Activity
|
||||
|
@ -66,7 +66,7 @@ fun YokaiScaffold(
|
|||
// modifier = Modifier.statusBarsPadding(),
|
||||
colors = topAppBarColors(
|
||||
containerColor = color,
|
||||
scrolledContainerColor = color,
|
||||
scrolledContainerColor = scrolledColor,
|
||||
),
|
||||
navigationIcon = {
|
||||
ToolTipButton(
|
||||
|
@ -85,7 +85,7 @@ fun YokaiScaffold(
|
|||
// modifier = Modifier.statusBarsPadding(),
|
||||
colors = topAppBarColors(
|
||||
containerColor = color,
|
||||
scrolledContainerColor = color,
|
||||
scrolledContainerColor = scrolledColor,
|
||||
),
|
||||
navigationIcon = {
|
||||
ToolTipButton(
|
||||
|
@ -104,10 +104,10 @@ fun YokaiScaffold(
|
|||
}
|
||||
|
||||
@Composable
|
||||
fun getTopAppBarColor(title: String): Color {
|
||||
fun getTopAppBarColor(title: String): Pair<Color, Color> {
|
||||
return when (title.isEmpty()) {
|
||||
true -> Color.Transparent
|
||||
false -> MaterialTheme.colorScheme.surface
|
||||
true -> Color.Transparent to Color.Transparent
|
||||
false -> MaterialTheme.colorScheme.surface to MaterialTheme.colorScheme.surfaceContainer
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue