If you are using AppBarLayout
, you have to add android:fitsSystemWindows="true"
to it.
Add it to the AppBarLayout and not to the root layout. Adding it to the root will move the complete view down, which is usually not what you want.
For reference: https://developer.android.com/about/versions/15/behavior-changes-15?hl=de#not-edge-to-edge