so I'm trying to have a translucent statusbar and navbar, where the status bar gets it's color from the toolbar and the navbar gets its color from the content being display underneat it.
Like this:
This however was made possible with some hackery:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<View
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="@drawable/alt_grad"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fitsSystemWindows="true"
...
/>
<android.support.design.widget.TabLayout
...
/>
<android.support.v4.view.ViewPager
...
/>
</RelativeLayout>
...
</android.support.v4.widget.DrawerLayout>
Notice the transparent toolbar and tablayout with the 300dp height view not respecting fitSystemWindows painting under then with the gradient.
Without this type of hackery this is as far as I can get to:
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/alt_grad"
android:fitsSystemWindows="true"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fitsSystemWindows="true"
/>
<android.support.design.widget.TabLayout
...
/>
<android.support.v4.view.ViewPager
...
/>
</RelativeLayout>
<android.support.design.widget.NavigationView
...
/>
</android.support.v4.widget.DrawerLayout>
Any ideas on how i can manage to do this? Thanks!