I want to draw my layout behind the status bar but not behind system navigation controls panel (at the bottom of display)
Right now I use WindowCompat.setDecorFitsSystemWindows(window, false) and layout takes all space of the display, but I only need to take space of status bar
So basically layout should ignore top inset (where status bar is) but it needs to pay attention to bottom inset (where system navigation bar is)
I could use <item name="android:windowTranslucentStatus">true</item> instead but this one draws "system dark transparent background" for status bar which I don't want to.
So I need something like <item name="android:windowTranslucentStatus">true</item> but without dark background with transparency for status bar
For my case I solved it like this (for layout of Activity):
It needs two
CoordinatorLayouts, the first withandroid:fitsSystemWindows="false"and the second withandroid:fitsSystemWindows="true"No need to use
WindowCompat.setDecorFitsSystemWindows(window, false)and<item name="android:windowTranslucentStatus">true</item>But it works only for specific cases.
In my case it was activity where it should place some content and it should be visible behind status bar as well but other content is being added by fragments to this activity and it's below status bar