<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->

<com.example.platform.ui.insets.animation.InsetsAnimationLinearLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/shape_rect"
    android:backgroundTint="@color/color_on_surface_5"
    android:orientation="vertical"
    tools:context=".ConversationFragment">

    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/toolbar"
        style="@style/Widget.MaterialComponents.Toolbar.Surface"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="@dimen/spacing_micro"
        app:menu="@menu/menu_main">

        <ImageView
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_marginEnd="@dimen/spacing_small"
            app:srcCompat="@drawable/ic_face" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/toolbar_title"
            android:textAppearance="?attr/textAppearanceHeadline6" />

    </com.google.android.material.appbar.MaterialToolbar>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/conversation_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="0px"
        android:layout_weight="1"
        android:clipToPadding="false"
        android:orientation="vertical"
        android:paddingVertical="@dimen/spacing_small"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        app:reverseLayout="true"
        tools:itemCount="20"
        tools:listitem="@layout/message_bubble_other" />

    <LinearLayout
        android:id="@+id/message_holder"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorSurface"
        android:elevation="@dimen/spacing_micro"
        android:padding="@dimen/spacing_small">

        <com.google.android.material.textfield.TextInputLayout
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
            android:layout_width="0px"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/spacing_micro"
            android:layout_weight="1">

            <EditText
                android:id="@+id/message_edittext"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/message_hint" />

        </com.google.android.material.textfield.TextInputLayout>

        <ImageButton
            style="@style/Widget.AppCompat.Button.Borderless.Colored"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:minWidth="48dp"
            android:minHeight="48dp"
            android:padding="@dimen/spacing_medium"
            app:srcCompat="@drawable/ic_send"
            app:tint="?attr/colorPrimary" />

    </LinearLayout>

</com.example.platform.ui.insets.animation.InsetsAnimationLinearLayout>