pref(Toolbar.kt): Toolbar 自定义标题

This commit is contained in:
HuanCheng65 2023-03-11 00:05:40 +08:00
parent c82ed238fe
commit 8db3645d9f
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
1 changed files with 24 additions and 0 deletions

View File

@ -257,6 +257,30 @@ fun Toolbar(
) )
} }
@Composable
fun Toolbar(
title: @Composable (() -> Unit),
navigationIcon: @Composable (() -> Unit)? = null,
actions: @Composable RowScope.() -> Unit = {},
content: @Composable (ColumnScope.() -> Unit)? = null
) {
TopAppBarContainer(
topBar = {
TopAppBar(
title = {
ProvideContentColor(color = ExtendedTheme.colors.onTopBar, content = title)
},
actions = actions,
navigationIcon = navigationIcon,
backgroundColor = ExtendedTheme.colors.topBar,
contentColor = ExtendedTheme.colors.onTopBar,
elevation = 0.dp
)
},
content = content
)
}
@Composable @Composable
fun TopAppBarContainer( fun TopAppBarContainer(