Colton Idle
02/08/2021, 10:08 PMModifier.statusBarsPadding()
to my Toolbar that's in a scaffold, but my statusbar is white instead of Purple (my Toolbar is purple). Am I doing something wrong?manueldidonna
02/08/2021, 11:58 PMstatusBarPadding
as a Toolbar modifier it acts like a top margin because it doesn't change the inner padding of the toolbar. You should wrap your Toolbar in a Surface applying both the color and the elevation of the toolbar to the surface.Colton Idle
02/09/2021, 7:17 PMScaffold(
topBar = {
TopAppBar(
modifier = Modifier.statusBarsPadding(),
title = { Text("Toolbar title") }
)
}) {
@cb hate to ping you directly, but could you shed some light on what I'm doing wrong?cb
02/09/2021, 7:19 PMcb
02/09/2021, 7:20 PMInsetAwareTopAppBar
in the library. Would that help?Colton Idle
02/09/2021, 7:20 PMcb
02/09/2021, 7:21 PMColton Idle
02/09/2021, 7:21 PMColton Idle
02/09/2021, 7:22 PMcb
02/09/2021, 7:23 PMColton Idle
02/09/2021, 7:23 PMcb
02/09/2021, 7:25 PMTopAppBar
doesn’t (yet) support inner content padding. So we fake it wrapping it in another Surface
.Colton Idle
02/09/2021, 7:25 PMInsetter.setEdgeToEdgeSystemUiFlags(window.decorView, true)
(I know on twitter you said that I don't need that anymore, and I can just use the WindowCompat api or whatever).
Then I wrapped my theme in ProvideWindowInsets
and then adding padding to Toolbar didn't work.Colton Idle
02/09/2021, 7:25 PMColton Idle
02/09/2021, 7:27 PMIt’s just becauseÂAha. Okay so it doesn't support it yet. Thats actually a huge relief. I was pretty much convinvced that it would just work with it. and when it didn't... I just thought my 2 months of work with E2E went down the drain and the world didn't make sense anymore. lol doesn’t (yet) support inner content padding. So we fake it wrapping it in anotherÂTopAppBar
.Surface
Colton Idle
02/09/2021, 8:01 PM