<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <include
        android:id="@+id/inAddresses"
        layout="@layout/include_message_addresses"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <include
        android:id="@+id/inHeaders"
        layout="@layout/include_message_headers"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/inAddresses" />

    <include
        android:id="@+id/inAttachments"
        layout="@layout/include_message_attachments"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/inHeaders" />

    <include
        android:id="@+id/inNavigation"
        layout="@layout/include_message_navigation"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/inAttachments" />

    <eu.faircode.email.FixedTextView
        android:id="@+id/tvNoInternetBody"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="12dp"
        android:text="@string/title_no_internet"
        android:textAppearance="@style/TextAppearance.AppCompat.Small"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/inNavigation" />

    <eu.faircode.email.FixedTextView
        android:id="@+id/tvDownloading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="12dp"
        android:text="@string/title_download_message"
        android:textAppearance="@style/TextAppearance.AppCompat.Small"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tvNoInternetBody" />

    <eu.faircode.email.ContentLoadingProgressBar
        android:id="@+id/pbDownloading"
        style="@style/Base.Widget.AppCompat.ProgressBar"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:indeterminate="true"
        app:layout_constraintBottom_toBottomOf="@id/tvDownloading"
        app:layout_constraintEnd_toEndOf="@id/tvDownloading"
        app:layout_constraintStart_toStartOf="@id/tvDownloading"
        app:layout_constraintTop_toTopOf="@id/tvDownloading" />

    <ImageButton
        android:id="@+id/ibDownloading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/title_download_message"
        app:layout_constraintBottom_toBottomOf="@+id/tvDownloading"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/tvDownloading"
        app:srcCompat="@drawable/baseline_info_24" />

    <eu.faircode.email.FixedTextView
        android:id="@+id/tvBody"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="6dp"
        android:layout_marginTop="3dp"
        android:layout_marginEnd="6dp"
        android:fontFamily="monospace"
        android:hyphenationFrequency="none"
        android:minHeight="60dp"
        android:paddingBottom="6dp"
        android:text="Body"
        android:textAppearance="@style/TextAppearance.AppCompat.Small"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tvDownloading" />

    <View
        android:id="@+id/wvBody"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="3dp"
        android:paddingBottom="6dp"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tvBody" />

    <ImageButton
        android:id="@+id/ibTrashBottom"
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/title_trash"
        android:padding="6dp"
        android:scaleType="fitCenter"
        android:tint="?attr/colorSeparator"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/wvBody"
        app:srcCompat="@drawable/baseline_delete_24" />

    <ImageButton
        android:id="@+id/ibArchiveBottom"
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:layout_marginStart="3dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/title_archive"
        android:padding="6dp"
        android:scaleType="fitCenter"
        android:tint="?attr/colorSeparator"
        app:layout_constraintStart_toEndOf="@id/ibTrashBottom"
        app:layout_constraintTop_toBottomOf="@id/wvBody"
        app:srcCompat="@drawable/baseline_archive_24" />

    <ImageButton
        android:id="@+id/ibSeen"
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/title_seen"
        android:padding="6dp"
        android:scaleType="fitCenter"
        android:tint="?attr/colorSeparator"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/wvBody"
        app:srcCompat="@drawable/baseline_visibility_24" />

    <include
        android:id="@+id/InAction"
        layout="@layout/include_message_action"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/ibSeen" />

    <include
        android:id="@+id/InCalendar"
        layout="@layout/include_message_calendar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/InAction" />

    <include
        android:id="@+id/inAttachmentsAlt"
        layout="@layout/include_message_attachments"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/InCalendar" />

    <include
        android:id="@+id/inImages"
        layout="@layout/include_message_images"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/inAttachmentsAlt" />

    <androidx.constraintlayout.widget.Group
        android:id="@+id/grpDownloading"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:constraint_referenced_ids="tvDownloading,pbDownloading,ibDownloading" />
</androidx.constraintlayout.widget.ConstraintLayout>
