<?xml version="1.0" encoding="utf-8"?><!--
  ~ Twidere - Twitter client for Android
  ~
  ~  Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
  ~
  ~  This program is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  This program 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/>.
  -->

<org.mariotaku.twidere.view.TintedStatusRelativeLayout
    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/conversationContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="visible"
    app:setPadding="true"
    tools:context=".fragment.message.MessagesConversationFragment">

    <include
        android:id="@+id/listContainer"
        layout="@layout/fragment_content_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/inputPanel"
        android:layout_below="@+id/toolbar"/>

    <View
        android:id="@+id/inputPanelShadowCompat"
        android:layout_width="match_parent"
        android:layout_height="@dimen/element_spacing_small"
        android:layout_above="@+id/inputPanel"
        android:background="@drawable/shadow_top"/>

    <RelativeLayout
        android:id="@+id/inputPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="?android:colorBackground"
        android:clipToPadding="false"
        android:gravity="bottom"
        android:orientation="horizontal"
        android:outlineProvider="bounds"
        android:padding="@dimen/element_spacing_normal"
        tools:ignore="UnusedAttribute">

        <org.mariotaku.twidere.view.IconActionView
            android:id="@+id/addMedia"
            android:layout_width="@dimen/element_size_normal"
            android:layout_height="@dimen/element_size_normal"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginEnd="@dimen/element_spacing_normal"
            android:layout_marginRight="@dimen/element_spacing_normal"
            android:background="?selectableItemBackgroundBorderless"
            android:clickable="true"
            android:contentDescription="@string/add_image"
            android:scaleType="centerInside"
            android:src="@drawable/ic_action_gallery"
            android:visibility="gone"
            app:iabColor="?android:textColorSecondary"
            tools:tint="?android:textColorSecondary"
            tools:visibility="visible"/>

        <FrameLayout
            android:id="@+id/sendMessageContainer"
            android:layout_width="@dimen/element_size_normal"
            android:layout_height="@dimen/element_size_normal"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true">

            <org.mariotaku.twidere.view.IconActionView
                android:id="@+id/sendMessage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="?selectableItemBackgroundBorderless"
                android:clickable="true"
                android:contentDescription="@string/action_send"
                android:scaleType="centerInside"
                android:src="@drawable/ic_action_send"
                app:iabColor="?android:textColorSecondary"
                tools:tint="?android:textColorSecondary"/>

            <com.pnikosis.materialishprogress.ProgressWheel
                android:id="@+id/sendProgress"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:visibility="gone"
                app:matProg_barColor="?colorAccent"
                app:matProg_barWidth="3dp"
                app:matProg_progressIndeterminate="true"/>
        </FrameLayout>

        <org.mariotaku.messagebubbleview.library.MessageBubbleView
            android:id="@+id/editTextContainer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignWithParentIfMissing="true"
            android:layout_gravity="end"
            android:layout_toEndOf="@+id/addMedia"
            android:layout_toLeftOf="@+id/sendMessageContainer"
            android:layout_toRightOf="@+id/addMedia"
            android:layout_toStartOf="@+id/sendMessageContainer"
            app:bubbleColor="?messageBubbleColor"
            app:caretHeight="@dimen/element_spacing_normal"
            app:caretPosition="topEnd"
            app:caretWidth="@dimen/element_spacing_normal"
            app:cornerRadius="2dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:minHeight="@dimen/element_size_normal"
                android:orientation="vertical"
                android:padding="@dimen/element_spacing_normal">

                <org.mariotaku.twidere.view.ComposeEditText
                    android:id="@+id/editText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:background="@null"
                    android:completionThreshold="1"
                    android:focusable="true"
                    android:gravity="start|center_vertical"
                    android:hint="@string/type_to_compose"
                    android:inputType="textMultiLine|textLongMessage|textCapSentences"
                    android:maxHeight="140dp"
                    android:textAppearance="?android:textAppearanceMedium"
                    android:textColor="?android:textColorPrimary"
                    android:textColorHint="?android:textColorTertiary">

                    <requestFocus/>
                </org.mariotaku.twidere.view.ComposeEditText>

                <org.mariotaku.twidere.view.ExtendedRecyclerView
                    android:id="@+id/attachedMediaPreview"
                    android:layout_width="match_parent"
                    android:layout_height="104dp"
                    android:layout_marginTop="@dimen/element_spacing_normal"
                    android:clipChildren="false"
                    tools:listitem="@layout/grid_item_media_editor"/>

            </LinearLayout>
        </org.mariotaku.messagebubbleview.library.MessageBubbleView>

    </RelativeLayout>

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        android:layout_alignParentTop="true"
        android:background="?colorToolbar"
        android:elevation="@dimen/toolbar_elevation"
        app:contentInsetStart="0dp"
        app:contentInsetStartWithNavigation="0dp"
        app:popupTheme="?actionBarPopupTheme"
        tools:elevation="0dp">

        <include layout="@layout/layout_toolbar_message_conversation_title"/>
    </android.support.v7.widget.Toolbar>

    <View
        android:id="@+id/windowOverlay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:background="?android:windowContentOverlay"/>
</org.mariotaku.twidere.view.TintedStatusRelativeLayout>