How can I make `TopAppBar` consume `Window Inset` ? Doing: ```TopAppBar( modifier = Modifier.fil...
a
How can I make
TopAppBar
consume
Window Inset
? Doing:
Copy code
TopAppBar(
    modifier = Modifier.fillMaxWidth()
        .statusBarsPadding()
        .wrapContentHeight(),
...
just result in something like this where the added padding is just white and not the TopAppbar Color.
n
I encountered the same problem. I wrote a slightly modified version of AppBar which propagates the modifier to the AppBar Content (a Row) instead of the surface. That fixed the problem for me. I don't know if there is a better solution though. You can find it here: https://github.com/Sh4dowSoul/Compose-Scrobbler/commit/31eb88edde860c4d6e74f0cf3440b701673197c8
a
Thats exactly what i though of doing as well.. but i was thinking whether this behavior was intended... or is it a “bug”
n
Yeah, I'm wondering about that as well
a
Hi @Adam Powell, is it possible to know if this was an expected behavior or is it something that will be changed in the future?
a
It's nonstandard to apply a modifier parameter to an inner element, but that's a standard, not a compiler-enforced rule. 🙂 Our library components are unlikely to be changed to work that way
But the standard components may be changed in the future to account for the insets in general.
n
Great, thanks for the info. It would be really nice to have the standard components handling the insets out of the box.
a
Alright thank you very much!