I have a layout that uses a coordinator layout as the root that has a collapsible toolbar and a header view. Underneath I have a recyclerview where I display a list of items. 

I have having a problem displaying the loadingView in the center of the recyclerview. I have been trying to use the constraint layout without success. So if the header is collapsed or expanded it should alway display in the center of the recyclerview and not the actual screen.

Here is my layout:

```
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/search_result_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:collapsedTitleGravity="left"
            app:contentScrim="@color/toolbar_color"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

            <include
                android:id="@+id/header"
                layout="@layout/list_header"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.3" />

            <cToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin" />

        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/contentView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <CustomOverlayLoadingView
            android:id="@+id/loadingView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="@id/contentView"
            app:layout_constraintTop_toTopOf="@id/contentView"
            android:visibility="gone"
            tools:visibility="visible" />
    </android.support.constraint.ConstraintLayout>
</android.support.design.widget.CoordinatorLayout> 

```

Update:
This is the image I get when I update with your answer. As you can see the image displays directly under the header. However, I would like it to be displayed in the center of the recyclerview.

[![enter image description here](https://i.stack.imgur.com/FYDcN.jpg)](https://i.stack.imgur.com/FYDcN.jpg)