<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    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:scrollbarStyle="insideOverlay"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

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

        <LinearLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:layout_marginLeft="12dip"
            android:layout_marginRight="12dip"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:minHeight="50dp">

            <EditText
                android:id="@+id/subject"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:hint="@string/message_compose_subject_hint"
                android:inputType="textEmailSubject|textAutoCorrect|textCapSentences"
                android:imeOptions="actionNext|flagNoExtractUi"
                android:singleLine="true"
                android:background="@android:color/transparent"
                android:paddingTop="10dp"
                android:paddingBottom="10dp"
                style="@style/ComposeEditTextLarge"
                />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider" />

        <!-- We have to use "wrap_content" (not "0dip") for "layout_height", otherwise the
             EditText won't properly grow in height while the user is typing the message -->
        <EditText
            android:id="@+id/message_content"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="top"
            android:hint="@string/message_compose_content_hint"
            android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
            android:imeOptions="actionDone|flagNoEnterAction|flagNoExtractUi"
            android:minLines="3"
            android:paddingLeft="12dip"
            android:paddingRight="12dip"
            style="@style/ComposeEditTextLarge"
            tools:ignore="InefficientWeight" />

        <EditText
            android:id="@+id/upper_signature"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="top"
            android:minLines="0"
            android:hint="@string/message_compose_signature_hint"
            android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
            android:imeOptions="flagNoExtractUi"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <Button
            android:id="@+id/quoted_text_show"
            android:text="@string/message_compose_show_quoted_text_action"
            android:textSize="16sp"
            android:padding="0dip"
            android:layout_gravity="right"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"/>

        <!-- Quoted text bar -->
        <RelativeLayout
            android:id="@+id/quoted_text_bar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/quoted_text"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="top"
                android:minLines="3"
                android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
                android:imeOptions="flagNoExtractUi"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <com.fsck.k9.view.MessageWebView
                android:id="@+id/quoted_html"
                android:layout_height="wrap_content"
                android:layout_width="fill_parent" />

            <LinearLayout
                android:id="@+id/quoted_text_buttons"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_alignParentRight="true">

                <ImageButton
                    android:id="@+id/quoted_text_edit"
                    android:contentDescription="@string/message_compose_description_edit_quoted_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="8dip"
                    android:background="@drawable/btn_edit" />

                <ImageButton
                    android:id="@+id/quoted_text_delete"
                    android:contentDescription="@string/message_compose_description_delete_quoted_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_dialog" />

            </LinearLayout>

        </RelativeLayout>

        <EditText
            android:id="@+id/lower_signature"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="top"
            android:minLines="0"
            android:hint="@string/message_compose_signature_hint"
            android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
            android:imeOptions="flagNoExtractUi"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <!--
            Empty container for storing attachments. We'll stick
            instances of message_compose_attachment.xml in here.
        -->
        <LinearLayout
            android:id="@+id/attachments"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:orientation="vertical" />

    </LinearLayout>

</ScrollView>
