<?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 OR GPL-2.0-only
-->
<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:orientation="vertical"
        android:layout_height="wrap_content"
        android:padding="@dimen/standard_padding"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_edit_share_link"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/share_permissions"
                android:textColor="@color/primary"
                android:textStyle="bold" />

            <RadioGroup
                android:id="@+id/share_radio_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

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

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

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

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

            </RadioGroup>

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/share_allow_download_and_sync_checkbox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:visibility="gone"
                android:text="@string/share_allow_download_and_sync_permission"
                tools:visibility="visible" />

            <LinearLayout
                android:id="@+id/custom_permission_layout"
                tools:visibility="visible"
                android:visibility="gone"
                android:layout_width="match_parent"
                android:orientation="vertical"
                android:layout_height="wrap_content">

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/share_custom_permissions_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/standard_margin"
                    android:text="@string/share_custom_permission"
                    android:textColor="@color/primary"
                    android:textStyle="bold"/>

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/share_read_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:enabled="false"
                    android:text="@string/share_read_permission"
                    tools:visibility="visible" />

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/share_create_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/share_create_permission"
                    tools:visibility="visible" />

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/share_edit_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/share_edit_permission"
                    tools:visibility="visible" />

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/share_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/share_re_share_permission"
                    tools:visibility="visible" />

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/share_delete_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/minimum_size_for_touchable_area"
                    android:text="@string/share_delete_permission"
                    tools:visibility="visible" />

            </LinearLayout>

            <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"/>

            <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"
                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"/>

            <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"
                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" />

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_set_download_limit_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_download_limit"
                android:visibility="gone" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/share_process_set_download_limit_input_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/download_limit"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:visibility="gone"
                tools:visibility="visible">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/share_process_set_download_limit_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:gravity="top"
                    android:importantForAutofill="no"
                    android:inputType="number"
                    android:maxLength="9">

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

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

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/share_process_hide_download_checkbox"
                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_via_link_hide_download"
                android:visibility="gone"
                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" />

            <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"
                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" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/share_process_message_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin"
                android:text="@string/share_send_note"
                android:textColor="@color/secondary_text_color"/>

            <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">

                <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"/>

            <LinearLayout
                android:orientation="horizontal"
                android:layout_marginTop="@dimen/standard_margin"
                android:gravity="end"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <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_marginEnd="@dimen/standard_half_margin"
                    android:text="@string/common_cancel"
                    app:cornerRadius="@dimen/button_corner_radius" />

                <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:text="@string/common_next"
                    android:theme="@style/Widget.Material3.Button.IconButton.Filled"
                    app:cornerRadius="@dimen/button_corner_radius"/>

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/bottom_navigation_view_margin" />

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
