gsala
06/11/2024, 7:56 AMWindowInset
APIs and the contentPadding
pattern used in the Scaffold
and LazyColumn
APIs.
I have to implement a translucent bottom navigation bar, and I think the default approach would be to pass the scaffold’s content padding down to any screen composable with scrollable content.
But I think it would be way easier to contribute to the WindowInsets instead of consuming from them (I don’t think I can consume a negative inset value 😄).
Alternatively I can have a separate CompisitionLocal
similar to insets’ to pass down the nav bar size, or any other app-wide content paddings.
What would be the preferred approach?KoskiA
06/11/2024, 3:10 PMModifierLocal
, basically copying how WindowInsets modifiers worked but for PaddingValues
, and adding helpers to consume WindowInsets
Timo Drick
06/11/2024, 5:18 PMgsala
06/11/2024, 6:53 PMgsala
06/11/2024, 6:55 PMTimo Drick
06/12/2024, 5:16 PMTimo Drick
06/12/2024, 5:29 PM