79570268

Date: 2025-04-12 09:44:16
Score: 1
Natty:
Report link

I tried your code on my device and, well... instead of overlapping the status bar, the status bar just vanished into the void, and the list took over the entire screen.

If you want your list to respect the status bar, this setup should do the trick:

LazyColumn(
    modifier = Modifier
        .padding(innerPadding) // 🪄 This line is where the magic happens
        .consumeWindowInsets(innerPadding)
        .windowInsetsPadding(
            WindowInsets.safeDrawing.only(
                WindowInsetsSides.Horizontal,
            ),
        ),
)

Why isn’t this the default behavior?

🤷‍♂️ No idea. Maybe one day I will find the answer.

Is this the "correct" way?

I found it in the official Now in Android codebase. So… probably?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
Posted by: Atick Faisal