Android - Keep ActionBar/Toolbar in front of Fragment animations
<p>I'm using <code>translate</code> animations to slide a fragment in from the bottom and out the top. During this animation, though, the <code>Toolbar</code> or <code>ActionBar</code> is sent to the back, making it look like there's some kind of glitch in the animation (the animated <code>Fragment</code> covers the <code>Toolbar</code>).</p>

<p>Is there a way to make sure the <code>Toolbar</code> is always shown in front of the animation? I did try setting the <code>:zAdjustment</code> to <code>bottom</code>, but that didn't change anything.</p>

<p>Here's one of the animations. The others are just variations of <code>:fromYDelta</code> and <code>:toYDelta</code>.</p>

<pre><code>&lt;set&gt;
    &lt;translate
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:fromYDelta="-100%"
        android:toYDelta="0"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:duration="1000"/&gt;
&lt;/set&gt;
</code></pre>

<p>The <code>FragmentTransaction</code></p>

<pre><code>getSupportFragmentManager().beginTransaction()
        .setCustomAnimations(R.anim.slide_in_bottom, R.anim.slide_out_top, R.anim.slide_in_top, R.anim.slide_out_bottom)
        .replace(R.id.master_container, getManageFragment())
        .addToBackStack(null)
        .commit();
</code></pre>

<p>This is my <code>activity_main.xml</code></p>

<pre><code>&lt;android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main_drawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"&gt;

    &lt;!-- The main content view --&gt;
    &lt;LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/master_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"&gt;

        &lt;include layout="@layout/navigation_toolbar" /&gt;

    &lt;/LinearLayout&gt;

    &lt;include layout="@layout/navigation_view" /&gt;

&lt;/android.support.v4.widget.DrawerLayout&gt;
</code></pre>

<p>And then this layout is added to <code>master_container</code></p>

<pre><code>&lt;android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/global_background"
    app:layout_behavior="com.cohenadair.anglerslog.views.FloatingButtonBehavior"&gt;

    &lt;android.support.v7.widget.RecyclerView
        android:id="@+id/main_recycler_view"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:paddingTop="@dimen/margin_half"
        android:paddingBottom="@dimen/margin_half"
        android:clipToPadding="false"/&gt;

    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/new_button"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_margin="@dimen/margin_default"
        android:src="@drawable/ic_add"
        app:elevation="0dp"
        app:layout_anchor="@id/main_recycler_view"
        app:layout_anchorGravity="bottom|right|end"
        app:layout_behavior="com.cohenadair.anglerslog.utilities.ScrollingFabBehavior"/&gt;

&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>Thank you.</p>

<p>EDIT: <a href="https://stackoverflow.com/questions/33047868/how-to-animate-view-slide-in-from-from-below-action-bar-and-slide-out-into-bot">This</a> seems to be a similar issue.</p>