Zoltan Demant
03/20/2024, 8:36 AMWindowInsets
for a platform? Id like to mimic the system UI of Android on Desktop for some of my screenshots.Stylianos Gakis
03/20/2024, 8:53 PMModifierLocalConsumedWindowInsets
which the inset modifiers seem to be using, but it looks like thatโs internal in the foundation.layout library.
But maybe I am missing something and you can create something that is a ModifierLocalProvider<WindowInsets>
and provide your own insets in there without having to access the internal value itself.
Maybe can get some inspiration from here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[โฆ]PaddingModifier&ss=androidx%2Fplatform%2Fframeworks%2Fsupport and provide just a hardcoded WindowInsets value? ๐
I have no idea how modifier locals work and how similar they are to composition locals, but I assume they work the same way, propagating down the tree of your composablesZoltan Demant
03/21/2024, 5:06 AMStylianos Gakis
03/21/2024, 8:11 AMZoltan Demant
03/21/2024, 10:16 AMinternal
. BUT, I dont think I fully understand how it all mangles together (sorry, I dont have time to look deeper into it right now ๐
).
I can for example use Modifier.windowInsetsPadding(bottom=48.dp)
which under the hood uses said key to provide some insets, but I think my scaffold eats that up since its just generic insets, and as such not excluded in the scaffold logic? Whereas I would need to specifically use WindowInsets.navigationBar
in order for it to pass through to my NavigationBar, etc. Dunno if that makes sense, fwiw the desktop logic: actual val WindowInsets.Companion.navigationBars: WindowInsets get() = ZeroInsets
is what Im trying to override, so that my NavigationBar actually has that extra padding, instead of it being added to my entire layout (=system navigation bar doesnt have same color as in app NavigationBar).Stylianos Gakis
03/21/2024, 10:27 AMZoltan Demant
03/21/2024, 11:45 AM