<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/main_activity_root_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/chat_background"
    android:orientation="vertical"
    tools:context="org.chat21.android.ui.messages.activities.MessageListActivity">

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

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/colorPrimary"
            app:contentInsetLeft="0dp"
            app:contentInsetStart="0dp"
            app:contentInsetStartWithNavigation="0dp">

            <include layout="@layout/layout_toolbar_message_list" />

        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/main_activity_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/main_activity_emoji_bar"
        android:layout_below="@+id/appbar"
        android:paddingBottom="@dimen/chat_padding_x_small"
        android:scrollbars="vertical" />

    <LinearLayout
        android:id="@+id/main_activity_emoji_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/chat_input_background"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:padding="4dp">

        <!--<ImageButton-->
        <!--android:id="@+id/main_activity_emoji"-->
        <!--android:layout_width="48dp"-->
        <!--android:layout_height="48dp"-->
        <!--android:background="?attr/selectableItemBackgroundBorderless"-->
        <!--android:padding="12dp"-->
        <!--android:scaleType="centerCrop"-->
        <!--app:srcCompat="@drawable/emoji_ios_category_people"-->
        <!--tools:ignore="ContentDescription" />-->

        <ImageButton
            android:id="@+id/main_activity_emoji"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:padding="12dp"
            android:scaleType="centerCrop"
            app:srcCompat="@drawable/emoji_ios_category_people"
            tools:ignore="ContentDescription" />


        <com.vanniktech.emoji.EmojiEditText
            android:id="@+id/main_activity_chat_bottom_message_edittext"
            android:layout_width="0dp"
            app:emojiSize="@dimen/chat_activity_message_list_last_message_emoji_size"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:imeOptions="actionSend|flagNoExtractUi"
            android:inputType="textCapSentences|textMultiLine"
            android:maxLines="3" />

        <ImageView
            android:id="@+id/main_activity_send"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:padding="12dp"
            android:scaleType="centerCrop"
            android:visibility="gone"
            app:srcCompat="@drawable/ic_send_24dp"
            tools:ignore="ContentDescription" />

        <ImageButton
            android:id="@+id/main_activity_attach"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:padding="12dp"
            android:scaleType="centerCrop"
            app:srcCompat="@drawable/ic_attachment_24dp"
            tools:ignore="ContentDescription" />
    </LinearLayout>

    <!--message placeholder layout to show when an user is removed from a group-->
    <RelativeLayout
        android:id="@+id/no_messages_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <ImageView
            android:id="@+id/error_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:src="@drawable/error_view_cloud" />

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/error_image"
            android:layout_marginTop="@dimen/chat_margin_normal"
            android:background="@drawable/activity_message_list_background_rounded_error_view"
            android:padding="@dimen/chat_padding_normal">

            <TextView
                android:id="@+id/error_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:gravity="center_horizontal"
                android:text="@string/activity_message_list_no_message_error_title_label"
                android:textColor="@color/activity_message_list_error_view_text"
                android:textSize="18sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/error_subtitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/error_title"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/chat_margin_small"
                android:text="@string/activity_message_list_no_message_error_subtitle_label"
                android:textColor="@color/activity_message_list_error_view_text_light" />
        </RelativeLayout>
    </RelativeLayout>
</RelativeLayout>