I know this is old, but I've just run into the same problem and found an easy solution, so I wanted to share it in case this was run into by anyone Google'ing around.
It seems that there is an Android bug when a ViewPager (especially an ImageSwitcher) is placed within a layout that has the attribute android:fitsSystemWindows="true"
. For some reason the system windows seem to be getting artifacts drawn all over them. :/
Anyway, I found a fix. For my activity, I had an XML layout as follows:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
<!-- NOT HERE! android:fitsSystemWindows="true" -->
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageSwitcher
android:id="@+id/background_image_switcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="0dp"
android:layout_margin="0dp"
android:background="@color/background_dark_navy"
android:inAnimation="@android:anim/fade_in"
android:outAnimation="@android:anim/fade_out"
>
<ImageView
style="@style/BlurredBackgroundImage"
/>
<ImageView
style="@style/BlurredBackgroundImage"
/>
</ImageSwitcher>
<FrameLayout
android:fitsSystemWindows="true" <!-- Here!!! -->
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Fitted content here -->
</FrameLayout>
The trick was to not contain the ImageSwitcher in a layout with the android:fitsSystemWindows="true"
attribute, but to instead move the android:fitsSystemWindows="true"
attribute to the inner FrameLayout containing the actual content I needed to fit (the title text in your case). Unfortunately, this allows for the ImageSwitcher/ViewPager's view to get slightly cut off by the system windows, but if the image is used like a background image anyway it doesn't matter too much and is a much better trade off than artifacts or maintaining all of the different dimensions/styles that may or may not have disabled navigation (such as the currently selected answer).
I hope this helps someone!