I have a screen with a transparent status bar and a ScrollView containing a hero image and then some other elements. The image should be drawn under the status bar. Everything looks fine on the first look but I've noticed that the last view in the ScrollView is clipped. It looks like the ScrollView height expands below the limits of the screen height. I can see the over scroll effect starting somewhere below the screen. When I use android:fitsSystemWindows="true" on the ScrollView it solves the problem but then I am not drawing under the status bar.
Some relevant code:
Fragment.onCreate
WindowCompat.setDecorFitsSystemWindows(requireActivity().window, false)
app theme
<item name="android:statusBarColor">@android:color/transparent</item>
I'm not sure if pasting the XML layout makes sense, but in pseudocode:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView />
<TextView />
<TextView />
<TextView />
<TextView />
</LinearLayout>
</ScrollView>