<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.

     This file is part of Xabber project; you can redistribute it and/or
     modify it under the terms of the GNU General Public License, Version 3.

     Xabber is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.

     You should have received a copy of the GNU General Public License,
     along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar_default"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"

        android:background="?attr/colorPrimary"
        android:elevation="8dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        >

        <include
            android:id="@+id/contact_title"
            layout="@layout/contact_title"
            />

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

    <android.support.v7.widget.RecyclerView
        android:id="@+id/chat_messages_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/input_layout"

        android:layout_below="@+id/toolbar_default"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:listSelector="@android:color/transparent"
        android:scrollbars="vertical"
        tools:listitem="@layout/chat_viewer_outgoing_message"
        />

    <LinearLayout
        android:id="@+id/input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/white"
        android:elevation="8dp"
        android:orientation="horizontal"
        >

        <ImageButton
            android:id="@+id/button_security"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@null"
            android:contentDescription="@string/otr_encryption"
            android:padding="8dp"
            android:src="@drawable/ic_security_grey_24dp"
            />

        <Space
            android:id="@+id/button_security_spacer"
            android:layout_width="16dp"
            android:layout_height="match_parent"
            android:visibility="gone"
            />

        <EditText
            android:id="@+id/chat_input"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:cursorVisible="true"
            android:fadingEdge="vertical"
            android:gravity="center_vertical"
            android:hint="@string/chat_input_hint"
            android:imeOptions="flagNoExtractUi"
            android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
            android:maxLines="4"
            android:minHeight="40dp"
            android:scrollbars="vertical"
         />

        <ImageButton
            android:id="@+id/button_send_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@null"
            android:contentDescription="@string/chat_send"
            android:padding="8dp"
            android:src="@drawable/ic_button_send"
            />
    </LinearLayout>

</RelativeLayout>
