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
)