0

I'm new to Android development. I use jetpack compose. The TopAppBar color elevates as you scroll. That's fine, but I also want to elevate the status bar at the same time to the same color. For example, Google clock app has the feature I want to achieve.

What I have tried:

Setting the status bar color to transparent:

val systemUiController = rememberSystemUiController()
systemUiController.setStatusBarColor(color = Color.Transparent)

Displaying content behind the status Bar

window.setFlags(
    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
)
  • Meterial You says the TopAppBar should be the same color as the background. However, if you scroll down below, then the TopAppBar should stand out. So the background color of the TopAppBar should elevate. I've already done that. Only the status bar does not update the color. So now the TopAppBar is dynamic but the statusbar has a static color... If the TopAppBar is changing the statusbar should too. It is described below and shown with pictures: https://m3.material.io/components/top-app-bar/guidelines#4eab4f50-4a3e-4189-bce2-a46514cde1da – NoVa Vineuro Nov 19 '22 at 08:12

0 Answers0