<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
    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"
    android:id="@+id/chat_app_bar"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/actionBarSize"
    android:background="@color/colorWhite"
    tools:context=".page.chat.BaseChatActivity">

    <RelativeLayout
        android:id="@+id/test_layout_id"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/chat_toolbar_back_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="15dp"
            android:contentDescription="@null"
            android:padding="5dp"
            android:src="@drawable/back" />

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/chat_toolbar_image_view"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_centerVertical="true"
            android:layout_marginEnd="10dp"
            android:layout_marginStart="66dp"
            android:contentDescription="@null"
            tools:src="@drawable/avatar" />

        <TextView
            android:id="@+id/chat_toolbar_single_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toEndOf="@+id/chat_toolbar_image_view"
            android:textColor="@color/colorBlack"
            android:textSize="15sp"
            android:textStyle="bold"
            android:visibility="gone"
            tools:text="Sample title" />

        <!-- TODO: Activated search view
            <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toEndOf="@+id/chat_toolbar_image_view"
            android:layout_toStartOf="@+id/chatSearchView"
            android:layout_marginEnd="-45dp"
            android:orientation="vertical">

            TODO: Deactivated search view
            <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toEndOf="@+id/chat_toolbar_image_view"
            android:layout_toStartOf="@+id/chat_toolbar_extra_image"
            android:orientation="vertical">
        -->

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toEndOf="@+id/chat_toolbar_image_view"
            android:layout_toStartOf="@+id/chatSearchView"
            android:layout_marginEnd="-45dp"
            android:orientation="vertical">

            <TextView
                android:id="@+id/chat_toolbar_group_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="top"
                android:textColor="@color/colorBlack"
                android:textSize="15sp"
                android:textStyle="bold"
                android:visibility="gone"
                tools:text="Gruppenname"
                tools:visibility="visible"/>

            <TextView
                android:id="@+id/chat_toolbar_group_members"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:gravity="top"
                android:maxLines="1"
                android:textColor="@color/colorManatee"
                android:textSize="11sp"
                android:visibility="gone"
                tools:ignore="SmallSp"
                tools:text="Lyndon Jetten, Sonja Estevao, Jörg Behr, Christian Bäurle, Markus Bäurle, Mike Gahn, Özlem Göktepe"
                tools:visibility="visible"/>
        </LinearLayout>

        <android.support.v7.widget.SearchView
            android:id="@+id/chatSearchView"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginStart="45dp"
            android:layout_toStartOf="@id/chat_toolbar_extra_image"
            android:paddingBottom="5dp"
            android:paddingStart="5dp"
            android:paddingEnd="0dp"
            android:paddingTop="5dp"
            app:iconifiedByDefault="true"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:theme="@style/AppTheme.Toolbar"
            app:queryHint="@string/search_view_hint"
            android:visibility="visible"
            />

        <ImageView
            android:id="@+id/chat_toolbar_extra_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="11dp"
            android:contentDescription="@null"
            android:padding="5dp"
            tools:src="@drawable/call" />
    </RelativeLayout>
</android.support.design.widget.AppBarLayout>
