<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021 TSI-mc
  ~ SPDX-FileCopyrightText: 2021 Nextcloud GmbH
  ~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:minHeight="400dp">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:padding="@dimen/standard_padding"
        app:layout_constraintBottom_toTopOf="@+id/share_process_btn_cancel"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

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

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_edit_share_link"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:text="@string/share_permissions"
                android:textColor="@color/primary"
                android:textStyle="bold"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <RadioGroup
                android:id="@+id/share_process_permission_radio_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_edit_share_link">

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/share_process_permission_read_only"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/link_share_view_only" />

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/share_process_permission_upload_editing"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/link_share_allow_upload_and_editing" />

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/share_process_permission_file_drop"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/link_share_file_drop" />

            </RadioGroup>

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_advance_permission_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin"
                android:text="@string/advanced_settings"
                android:textColor="@color/primary"
                android:textStyle="bold"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_permission_radio_group" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/share_process_allow_resharing_checkbox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/allow_resharing"
                android:visibility="gone"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_advance_permission_title"
                tools:visibility="visible" />

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_set_password_switch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/share_no_password_title"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_allow_resharing_checkbox" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/share_process_enter_password_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_password"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_set_password_switch"
                tools:visibility="visible">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/share_process_enter_password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="password"
                    android:ems="10"
                    android:gravity="top"
                    android:inputType="textPassword">

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

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

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_set_exp_date_switch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/share_no_expiration_date_label"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_enter_password_container" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_select_exp_date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:padding="@dimen/standard_half_padding"
                android:visibility="gone"
                app:drawableEndCompat="@drawable/file_calendar"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_set_exp_date_switch"
                tools:visibility="visible" />

            <View
                android:id="@+id/share_process_exp_date_divider"
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:background="@color/text_color"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_select_exp_date" />

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_hide_download_checkbox"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/share_via_link_hide_download"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_exp_date_divider"
                tools:visibility="visible" />

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_change_name_switch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/link_name"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_hide_download_checkbox" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/share_process_change_name_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_name"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_change_name_switch"
                tools:visibility="visible">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/share_process_change_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:gravity="top"
                    android:importantForAutofill="no"
                    android:inputType="textNoSuggestions|textCapSentences">

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

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

            <androidx.constraintlayout.widget.Group
                android:id="@+id/share_process_group_one"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="visible"
                app:constraint_referenced_ids="share_process_exp_date_divider,
                share_process_permission_radio_group,
                share_process_advance_permission_title, share_process_hide_download_checkbox,
                share_process_allow_resharing_checkbox, share_process_set_password_switch,
                share_process_set_exp_date_switch, share_process_enter_password_container,
                share_process_select_exp_date, share_process_change_name_switch,
                share_process_change_name_container" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_message_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin"
                android:text="@string/share_send_note"
                android:textColor="@color/secondary_text_color"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_edit_share_link" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/note_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:hint="@string/hint_note"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/share_process_message_title">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/note_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="top"
                    android:importantForAutofill="no"
                    android:inputType="textCapSentences|textMultiLine|textNoSuggestions"
                    android:minLines="10"
                    android:scrollbars="vertical" />
            </com.google.android.material.textfield.TextInputLayout>

            <androidx.constraintlayout.widget.Group
                android:id="@+id/share_process_group_two"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:constraint_referenced_ids="share_process_message_title, note_container" />

        </androidx.constraintlayout.widget.ConstraintLayout>

    </androidx.core.widget.NestedScrollView>

    <com.google.android.material.button.MaterialButton
        android:id="@+id/share_process_btn_cancel"
        style="@style/Widget.Material3.Button.OutlinedButton"
        android:layout_width="@dimen/button_width"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/standard_margin"
        android:layout_marginEnd="@dimen/standard_half_margin"
        android:layout_marginBottom="@dimen/standard_margin"
        android:text="@string/common_cancel"
        app:cornerRadius="@dimen/button_corner_radius"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/share_process_btn_next"
        app:layout_constraintTop_toTopOf="@+id/share_process_btn_next" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/share_process_btn_next"
        android:layout_width="@dimen/button_extra_width"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/standard_half_margin"
        android:layout_marginEnd="@dimen/standard_margin"
        android:layout_marginBottom="@dimen/standard_margin"
        android:text="@string/common_next"
        android:theme="@style/Widget.Material3.Button.IconButton.Filled"
        app:cornerRadius="@dimen/button_corner_radius"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
