<?xml version="1.0" encoding="utf-8"?>
<eu.faircode.email.ScrollViewEx 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"
    android:padding="24dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvCaption"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="@string/title_search"
            android:textAppearance="@style/TextAppearance.AppCompat.Large"
            app:layout_constraintEnd_toStartOf="@id/ibUnseen"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageButton
            android:id="@+id/ibUnseen"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:layout_marginEnd="12dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/title_info"
            android:padding="6dp"
            android:scaleType="fitCenter"
            android:tooltipText="@string/title_info"
            app:layout_constraintEnd_toStartOf="@+id/ibFlagged"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/baseline_mail_24" />

        <ImageButton
            android:id="@+id/ibFlagged"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:layout_marginEnd="12dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/title_accessibility_flagged"
            android:padding="6dp"
            android:scaleType="fitCenter"
            android:tooltipText="@string/title_info"
            app:layout_constraintEnd_toStartOf="@+id/ibInfo"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/baseline_star_24" />

        <ImageButton
            android:id="@+id/ibInfo"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/title_info"
            android:padding="6dp"
            android:scaleType="fitCenter"
            android:tooltipText="@string/title_info"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/baseline_info_24" />

        <AutoCompleteTextView
            android:id="@+id/etQuery"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:completionThreshold="2"
            android:hint="@string/title_search_for_hint"
            android:imeOptions="actionGo"
            android:inputType="text"
            android:maxLines="1"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/ibInfo" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvHint"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etQuery" />

        <ImageButton
            android:id="@+id/ibMore"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:padding="3dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvHint"
            app:srcCompat="@drawable/expander" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvMore"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:gravity="center_vertical"
            android:paddingStart="6dp"
            android:text="@string/title_search_more"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintBottom_toBottomOf="@+id/ibMore"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/ibMore"
            app:layout_constraintTop_toTopOf="@+id/ibMore" />

        <CheckBox
            android:id="@+id/cbSearchIndex"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_use_index"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/ibMore" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvSearchIndexHint"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_search_index_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbSearchIndex" />

        <CheckBox
            android:id="@+id/cbSenders"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:checked="true"
            android:text="@string/title_search_in_senders"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvSearchIndexHint" />

        <CheckBox
            android:id="@+id/cbRecipients"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:checked="true"
            android:text="@string/title_search_in_recipients"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbSenders" />

        <CheckBox
            android:id="@+id/cbSubject"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:checked="true"
            android:text="@string/title_search_in_subject"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbRecipients" />

        <CheckBox
            android:id="@+id/cbKeywords"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_in_keywords"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbSubject" />

        <CheckBox
            android:id="@+id/cbMessage"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:checked="true"
            android:text="@string/title_search_in_message"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbKeywords" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvSearchTextHint"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="6dp"
            android:text="@string/title_search_text_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbMessage" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvAnd"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvSearchTextHint" />

        <CheckBox
            android:id="@+id/cbUnseen"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with_unseen"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvAnd" />

        <CheckBox
            android:id="@+id/cbFlagged"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with_flagged"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbUnseen" />

        <CheckBox
            android:id="@+id/cbHidden"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with_hidden"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbFlagged" />

        <CheckBox
            android:id="@+id/cbEncrypted"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with_encrypted"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbHidden" />

        <CheckBox
            android:id="@+id/cbAttachments"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="12dp"
            android:text="@string/title_search_with_attachments"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbEncrypted" />

        <Button
            android:id="@+id/btnAfter"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="120dp"
            android:text="@string/title_search_with_after"
            app:layout_constraintEnd_toStartOf="@id/btnBefore"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbAttachments" />

        <Button
            android:id="@+id/btnBefore"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="120dp"
            android:text="@string/title_search_with_before"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/btnAfter"
            app:layout_constraintTop_toBottomOf="@id/cbAttachments" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvAfter"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="January 1st, 1970"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintEnd_toEndOf="@id/btnAfter"
            app:layout_constraintStart_toStartOf="@id/btnAfter"
            app:layout_constraintTop_toBottomOf="@id/btnAfter" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvBefore"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="January 1st, 1970"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintEnd_toEndOf="@id/btnBefore"
            app:layout_constraintStart_toStartOf="@id/btnBefore"
            app:layout_constraintTop_toBottomOf="@id/btnBefore" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpMore"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
            cbSearchIndex,tvSearchIndexHint,cbSenders,cbRecipients,cbSubject,cbKeywords,cbMessage,tvSearchTextHint,
            tvAnd,cbUnseen,cbFlagged,cbHidden,cbEncrypted,cbAttachments,
            btnAfter,btnBefore,tvBefore,tvAfter" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>