<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
        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="match_parent"
        android:fitsSystemWindows="true">

    <include
        android:id="@+id/app_bar_drawer"
        layout="@layout/app_bar_drawer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="16dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" android:paddingStart="15dp" android:paddingEnd="15dp" android:paddingTop="10dp" android:paddingBottom="10dp" android:id="@+id/share_root_view">

        <ProgressBar
                style="?android:attr/progressBarStyle"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:id="@+id/share_progress"
                app:layout_constraintEnd_toEndOf="parent"
                android:indeterminate="true" android:visibility="visible" app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="5dp"/>
        <TextView
                android:id="@+id/share_content_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:paddingTop="5dp"
                android:paddingBottom="2dp"
                android:text="@string/share_content_title"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" android:layout_marginStart="1dp"/>
        <com.google.android.material.imageview.ShapeableImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" app:srcCompat="@drawable/ic_cancel_gray_24dp"
                android:id="@+id/share_content_image" app:layout_constraintStart_toStartOf="parent"
                android:scaleType="fitStart"
                android:adjustViewBounds="true" android:maxHeight="150dp"
                app:shapeAppearanceOverlay="@style/roundedCornersImageView" android:visibility="visible"
                app:layout_constraintTop_toBottomOf="@id/share_content_title" android:layout_marginTop="5dp" android:layout_marginStart="1dp"/>
        <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/share_content_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" android:hint="@string/share_content_text_hint"
                android:importantForAutofill="no"
                android:backgroundTint="?attr/colorPrimary"
                app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
                android:lines="10" android:gravity="start|top" app:layout_constraintTop_toBottomOf="@id/share_content_image" android:minLines="1" android:layout_marginTop="5dp"/>
        <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@id/share_content_text"
                android:id="@+id/share_content_file_box" app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                android:visibility="visible" android:layout_marginTop="5dp"
                android:background="?android:attr/selectableItemBackground"
                android:clickable="true" android:focusable="true" android:padding="4dp" android:paddingStart="0dp">
            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" app:srcCompat="@drawable/ic_cancel_gray_24dp"
                    android:id="@+id/share_content_file_icon" app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/share_content_file_info" android:layout_marginEnd="5dp"
                    app:layout_constraintBottom_toBottomOf="parent"
            />
            <TextView
                    android:text="some file.mp3\n7.1 MB"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/share_content_file_info"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textAppearance="@style/TextAppearance.AppCompat.Small"
                    app:layout_constraintStart_toEndOf="@+id/share_content_file_icon"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="@+id/share_content_file_icon"
                    app:layout_constraintBottom_toBottomOf="@+id/share_content_file_icon"/>
        </androidx.constraintlayout.widget.ConstraintLayout>
        <TextView
                android:id="@+id/share_topic_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:paddingTop="5dp"
                android:paddingBottom="3dp"
                android:text="@string/share_topic_title"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/share_content_file_box" android:layout_marginTop="20dp" android:layout_marginStart="1dp"/>
        <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/share_topic_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" android:hint="@string/add_dialog_topic_name_hint"
                android:importantForAutofill="no"
                android:backgroundTint="?attr/colorPrimary"
                android:maxLines="1" android:inputType="text|textNoSuggestions" android:maxLength="64"
                app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/share_topic_title" android:layout_marginStart="-3dp"/>
        <CheckBox
                android:text="@string/add_dialog_use_another_server"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" android:id="@+id/share_use_another_server_checkbox"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/share_topic_text" android:paddingTop="-5dp" android:layout_marginTop="-5dp" android:layout_marginStart="-5dp"/>
        <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense.ExposedDropdownMenu"
                android:id="@+id/share_base_url_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="0dp"
                android:padding="0dp"
                android:visibility="visible"
                app:endIconMode="custom"
                app:hintEnabled="false"
                app:boxBackgroundColor="@null"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/share_use_another_server_checkbox" app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="-5dp">
            <AutoCompleteTextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/share_base_url_text"
                    android:hint="@string/app_base_url"
                    android:maxLines="1"
                    android:layout_marginTop="-5dp"
                    android:layout_marginBottom="0dp"
                    android:inputType="textUri|textNoSuggestions"
                    android:paddingStart="0dp"
                    android:paddingEnd="0dp"
                    android:paddingTop="5dp"
                    android:paddingBottom="5dp"
                    android:layout_marginStart="4dp" android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
        </com.google.android.material.textfield.TextInputLayout>
        <TextView
                android:id="@+id/share_last_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:paddingTop="5dp"
                android:paddingBottom="8dp"
                android:text="@string/share_suggested_topics"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                app:layout_constraintTop_toBottomOf="@id/share_base_url_layout" app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="13dp"/>
        <androidx.recyclerview.widget.RecyclerView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:id="@+id/share_suggested_topics"
                app:layout_constraintTop_toBottomOf="@id/share_last_title"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                android:clickable="true"
                android:focusable="true"
                android:background="?android:attr/selectableItemBackground"
                app:layoutManager="LinearLayoutManager"/>
        <TextView
                android:text="Unable to resolve host example.com"
                android:layout_width="0dp"
                android:layout_height="wrap_content" android:id="@+id/share_error_text"
                android:paddingStart="4dp"
                app:layout_constraintEnd_toEndOf="parent"
                android:paddingEnd="4dp"
                android:textAppearance="@style/DangerText"
                app:layout_constraintStart_toEndOf="@id/share_error_image"
                android:layout_marginTop="10dp" app:layout_constraintTop_toBottomOf="@id/share_suggested_topics"/>
        <ImageView
                android:layout_width="20dp"
                android:layout_height="20dp" app:srcCompat="@drawable/ic_error_red_24dp"
                android:id="@+id/share_error_image"
                android:visibility="visible"
                app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/share_error_text" android:layout_marginTop="2dp"/>

    </androidx.constraintlayout.widget.ConstraintLayout>

    </ScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
