Dima Avdeev
06/29/2023, 4:52 PMDima Avdeev
06/29/2023, 4:53 PMDima Avdeev
06/29/2023, 4:54 PMTopAppBar(
contentPadding = WindowInsets.systemBars
.only(WindowInsetsSides.Horizontal + <http://WindowInsetsSides.Top|WindowInsetsSides.Top>)
.asPaddingValues(),
) {
Text("Title")
}
[Updated info]
In this case we can't use title = { }
, navigationIcon = {}
and actions = {}
arguments. Only single content lambda.Stylianos Gakis
06/29/2023, 4:57 PMDima Avdeev
06/29/2023, 4:57 PMTopAppBar(
modifier = Modifier.windowInsetsPadding(WindowInsets.systemBars)
) {
Text("Title")
}
In this case top background under system bar is not controlled by TopAppBar.
[Updated info]
We can use title = { }
, navigationIcon = {}
and actions = {}
Stylianos Gakis
06/29/2023, 4:57 PMDima Avdeev
06/29/2023, 5:06 PMhttps://google.github.io/accompanist/insets/#inset-aware-layouts-insets-ui@Stylianos Gakis Thanks for info, but this page is deprecated.
Stylianos Gakis
06/29/2023, 5:25 PMDima Avdeev
06/29/2023, 6:29 PMalex009
06/29/2023, 6:35 PMmohamed rejeb
06/29/2023, 6:44 PMStylianos Gakis
06/29/2023, 6:47 PMWindowInsetsSides.Horizontal
too, and make sure that whatever API you make does work with that too 😊Dima Avdeev
06/29/2023, 6:53 PMfun TopAppBar(
title: @Composable () -> Unit,
modifier: Modifier = Modifier,
navigationIcon: @Composable (() -> Unit)? = null,
actions: @Composable RowScope.() -> Unit = {},
backgroundColor: Color = MaterialTheme.colors.primarySurface,
contentColor: Color = contentColorFor(backgroundColor),
elevation: Dp = AppBarDefaults.TopAppBarElevation
)
and
fun TopAppBar(
modifier: Modifier = Modifier,
backgroundColor: Color = MaterialTheme.colors.primarySurface,
contentColor: Color = contentColorFor(backgroundColor),
elevation: Dp = AppBarDefaults.TopAppBarElevation,
contentPadding: PaddingValues = AppBarDefaults.ContentPadding,
content: @Composable RowScope.() -> Unit
)
So we can't use contentPadding with title, etc.Stylianos Gakis
06/29/2023, 6:56 PMcan’t use contentPadding with title, etc.Yeah, and that’s exactly the one missing API from material2 that accompanist insets-ui is providing. https://github.com/google/accompanist/blob/96f477ccc9f4adb60ebe906ad95dc7cb9a37db7[…]-ui/src/main/java/com/google/accompanist/insets/ui/TopAppBar.kt
Dima Avdeev
06/29/2023, 6:57 PMAlex Vanyo
06/29/2023, 8:49 PMSam Stone
06/29/2023, 11:10 PM