<?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="match_parent"
    android:padding="16dp">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/label_text_input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/source_edit_label"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/labelEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:maxLines="1" />

    </com.google.android.material.textfield.TextInputLayout>

    <TextView
        android:id="@+id/format_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/source_edit_format"
        android:textAppearance="@style/TextAppearance.AppCompat.Body2"
        app:layout_constraintBottom_toTopOf="@+id/type_text_view"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/label_text_input_layout" />

    <com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/format_button_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        app:checkedButton="@+id/block_format_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toEndOf="@+id/format_text_view"
        app:layout_constraintTop_toBottomOf="@+id/label_text_input_layout"
        app:singleSelection="true">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/block_format_button"
            style="?attr/materialButtonOutlinedStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/source_edit_format_block_list" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/allow_format_button"
            style="?attr/materialButtonOutlinedStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/source_edit_format_allow_list" />

    </com.google.android.material.button.MaterialButtonToggleGroup>

    <TextView
        android:id="@+id/type_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/source_edit_type"
        android:textAppearance="@style/TextAppearance.AppCompat.Body2"
        app:layout_constraintBottom_toTopOf="@+id/url_text_input_layout"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/format_text_view" />

    <com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/type_button_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        app:checkedButton="@+id/url_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toEndOf="@+id/type_text_view"
        app:layout_constraintTop_toBottomOf="@+id/format_button_group"
        app:singleSelection="true">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/url_button"
            style="?attr/materialButtonOutlinedStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/source_edit_url" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/file_button"
            style="?attr/materialButtonOutlinedStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/source_edit_file" />

    </com.google.android.material.button.MaterialButtonToggleGroup>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/url_text_input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:hint="@string/source_edit_url_location"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/type_button_group">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/location_edit_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/source_edit_url_location_default" />

    </com.google.android.material.textfield.TextInputLayout>

    <TextView
        android:id="@+id/file_location_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:text="@string/source_edit_file_hint"
        android:textAppearance="@style/TextAppearance.AppCompat.Body2"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="@+id/redirected_hosts_checkbox"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/type_button_group" />

    <com.google.android.material.checkbox.MaterialCheckBox
        android:id="@+id/redirected_hosts_checkbox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="@string/source_edit_redirected_hosts"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/url_text_input_layout">

    </com.google.android.material.checkbox.MaterialCheckBox>

    <TextView
        android:id="@+id/redirected_hosts_warning_text_view"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:justificationMode="inter_word"
        android:text="@string/source_edit_redirected_hosts_warning"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/redirected_hosts_checkbox" />
</androidx.constraintlayout.widget.ConstraintLayout>
