<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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/activity_compose"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:layout_marginBottom="8dp"
            android:background="@android:color/transparent">

            <ImageView
                android:id="@+id/composeAvatar"
                android:layout_width="?attr/actionBarSize"
                android:layout_height="?attr/actionBarSize"
                android:layout_gravity="right|end"
                android:padding="8dp"
                tools:ignore="ContentDescription" />
            <!--content description will be set in code -->
        </android.support.v7.widget.Toolbar>

        <TextView
            android:id="@+id/reply_tv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="6dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:textSize="?attr/status_text_small"
            android:textStyle="bold"
            android:visibility="gone"
            tools:text="Reply to @username"
            tools:visibility="visible" />

        <TextView
            android:id="@+id/reply_content_tv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="2dp"
            android:background="?attr/compose_reply_content_background"
            android:paddingBottom="4dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:paddingTop="4dp"
            android:textSize="?attr/status_text_small"
            android:visibility="gone"
            tools:text="Post content which may be preeettyy long, so please, make sure there's enough room for everything, okay? Not kidding. I wish Eugen answered me more often, sigh."
            tools:visibility="visible" />

        <LinearLayout
            android:id="@+id/compose_content_warning_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:orientation="vertical">

            <EditText
                android:id="@+id/field_content_warning"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/transparent"
                android:ems="10"
                android:hint="@string/hint_content_warning"
                android:inputType="text|textCapSentences"
                android:maxLines="1"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:textSize="?attr/status_text_medium" />

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

        </LinearLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:paddingBottom="4dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp">

            <com.keylesspalace.tusky.view.EditTextTyped
                android:id="@+id/compose_edit_field"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/transparent"
                android:completionThreshold="2"
                android:dropDownWidth="wrap_content"
                android:ems="10"
                android:gravity="start|top"
                android:hint="@string/hint_compose"
                android:inputType="text|textMultiLine|textCapSentences"
                android:textSize="?attr/status_text_large" />

            <HorizontalScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true">

                <LinearLayout
                    android:id="@+id/compose_media_preview_bar"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <!--This is filled at runtime with ImageView's for each preview in the upload queue.-->

                </LinearLayout>

            </HorizontalScrollView>

            <ProgressBar
                android:id="@+id/postProgress"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true" />

        </RelativeLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:paddingBottom="8dp"
            android:paddingEnd="16dp"
            android:paddingStart="8dp"
            android:paddingTop="4dp">

            <ImageButton
                android:id="@+id/compose_photo_pick"
                style="?attr/image_button_style"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:contentDescription="@string/action_photo_pick"
                android:paddingBottom="4dp"
                android:paddingEnd="4dp"
                android:paddingLeft="4dp"
                android:paddingRight="4dp"
                android:paddingStart="4dp"
                android:paddingTop="4dp"
                app:srcCompat="@drawable/ic_attach_file_24dp" />

            <ImageButton
                android:id="@+id/action_toggle_visibility"
                style="?attr/image_button_style"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:contentDescription="@string/action_compose_options"
                android:paddingBottom="4dp"
                android:paddingEnd="4dp"
                android:paddingLeft="4dp"
                android:paddingRight="4dp"
                android:paddingStart="4dp"
                android:paddingTop="4dp"
                app:srcCompat="@drawable/ic_public_24dp" />

            <ImageButton
                android:id="@+id/compose_save_draft"
                style="?attr/image_button_style"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:contentDescription="@string/action_save"
                android:paddingBottom="4dp"
                android:paddingEnd="4dp"
                android:paddingLeft="4dp"
                android:paddingRight="4dp"
                android:paddingStart="4dp"
                android:paddingTop="4dp"
                app:srcCompat="@drawable/ic_save_24dp" />

            <ImageButton
                android:id="@+id/action_hide_media"
                style="?attr/image_button_style"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:contentDescription="@string/action_hide_media"
                android:paddingBottom="4dp"
                android:paddingEnd="4dp"
                android:paddingLeft="4dp"
                android:paddingRight="4dp"
                android:paddingStart="4dp"
                android:paddingTop="4dp"
                android:visibility="gone"
                app:srcCompat="@drawable/ic_hide_media_24dp" />

            <android.support.v4.widget.Space
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <TextView
                android:id="@+id/characters_left"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?android:textColorPrimary"
                android:textSize="?attr/status_text_medium" />

            <Button
                android:id="@+id/floating_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:background="@drawable/compose_button_colors"
                android:text="@string/action_send"
                android:textColor="@android:color/white"
                android:textSize="?attr/status_text_medium" />

        </LinearLayout>

    </LinearLayout>

</android.support.design.widget.CoordinatorLayout>