Mark
07/20/2024, 10:02 AMMark
07/20/2024, 10:12 AMcaptionBarPadding
. So I should just add captionBarPadding
alongside wherever I have statusBarPadding
?Alex Vanyo
07/20/2024, 2:15 PMcaptionBarPadding
as well, which is a type of inset for the title bar in free-form windows.
captionBarPadding
is included in systemBarsPadding
(along well as statusBar
and navigationBars
) and safeDrawingPadding
so you could also switch to a more general inset type to handle these cases.Mark
07/21/2024, 7:46 AMTopBar
so I only want statusBar
and captionBar
to be taken into consideration because I only want the top padding to be taken into consideration. Is there a cleaner way to do this?
TopAppBar(
modifier = modifier,
windowInsets = WindowInsets.statusBars.add(WindowInsets.captionBar),
Here’s the screenshot without the WindowInsets.captionBar
added. I don’t know for sure if the above solves the problem, but I guess it does.Tolriq
07/21/2024, 5:53 PMAlex Vanyo
07/21/2024, 6:17 PM.only(<http://WindowInsetsSides.Top|WindowInsetsSides.Top>)
to only apply a certain side of insets - that should be a more flexible solution than assuming that certain insets are only applied on certain sides, I don't think that's necessarily guaranteedAlex Vanyo
07/21/2024, 6:18 PMWindowInsets.safeDrawing.only(<http://WindowInsetsSides.Top|WindowInsetsSides.Top>)
will also include the display cutout as @Tolriq mentionedTolriq
07/21/2024, 6:19 PMAlex Vanyo
07/21/2024, 6:26 PMAlex Vanyo
07/21/2024, 6:28 PMTolriq
07/21/2024, 6:31 PMMark
07/22/2024, 6:47 AMwindowInsets = WindowInsets.safeDrawing.only(WindowInsetsSides.Top)
on the TopAppBar
I notice (on the emulator - Pixel 6, API31) the camera cutout still appears within the TopAppBar
bounds. It’s actually a good thing because I have quite a bit of top padding and so it just eats into that, which is not a problem. Is this intentional? Is there something that allows WindowInsets to creep into such padding? Otherwise, wouldn’t you expect there to be extra space above the hamburger icon vs. below it.Tolriq
07/22/2024, 6:57 AMMark
07/22/2024, 7:03 AM