<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="@dimen/standard_half_margin">

    <TextView
        android:id="@+id/publicShareDialogTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="@dimen/standard_half_padding"
        android:text="@string/share_via_link_create_title"
        android:textAppearance="@android:style/TextAppearance.Material.DialogWindowTitle"
        android:accessibilityHeading="true"/>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

            <LinearLayout
                android:id="@+id/shareViaLinkNameSection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:orientation="horizontal">

                <TextView
                    android:labelFor="@+id/shareViaLinkNameValue"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/standard_half_padding"
                    android:text="@string/share_via_link_name_label"
                    android:textColor="@color/black"
                    android:textSize="15sp" />

                <EditText
                    android:id="@+id/shareViaLinkNameValue"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="@dimen/standard_half_padding"
                    android:inputType="textNoSuggestions"
                    android:textSize="15sp" />

            </LinearLayout>

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

                <RadioButton
                    android:id="@+id/shareViaLinkEditPermissionReadOnly"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:text="@string/share_via_link_edit_permission_read_only_label" />

                <RadioButton
                    android:id="@+id/shareViaLinkEditPermissionReadAndWrite"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/share_via_link_edit_permission_read_and_write_label" />

                <RadioButton
                    android:id="@+id/shareViaLinkEditPermissionUploadFiles"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/share_via_link_edit_permission_upload_only_label" />

            </RadioGroup>

            <RelativeLayout
                android:id="@+id/shareViaLinkPasswordSection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin">

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/shareViaLinkPasswordSwitch"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentTop="true"
                    android:padding="@dimen/standard_half_padding" />

                <TextView
                    android:id="@+id/shareViaLinkPasswordLabel"
                    android:labelFor="@+id/shareViaLinkPasswordSwitch"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
                    android:paddingLeft="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/share_via_link_password_label"
                    android:textColor="@color/black"
                    android:textSize="15sp" />

            </RelativeLayout>

            <EditText
                android:id="@+id/shareViaLinkPasswordValue"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/standard_half_margin"
                android:layout_marginRight="@dimen/standard_half_margin"
                android:inputType="textPassword"
                android:visibility="gone" />

            <LinearLayout
                android:id="@+id/layoutPasswordGeneratorButtons"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:visibility="gone">

                <androidx.appcompat.widget.AppCompatButton
                    android:id="@+id/generatePasswordButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/share_via_link_generate_password_button"
                    android:backgroundTint="@color/transparent"
                    android:textColor="@color/primary_button_background_color"
                    style="?android:attr/borderlessButtonStyle"/>

                <androidx.appcompat.widget.AppCompatButton
                    android:id="@+id/copyPasswordButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/share_via_link_copy_password_button"
                    android:backgroundTint="@color/transparent"
                    android:textColor="@color/grey"
                    android:enabled="false"
                    style="?android:attr/borderlessButtonStyle" />

            </LinearLayout>

                <TextView
                    android:id="@+id/shareViaLinkPasswordPolicyIntro"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:text="@string/password_policy_intro"
                    android:visibility="gone" />

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyMinCharacters"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinCharactersIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinCharactersText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyUpperCaseCharacters"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyUpperCaseCharactersIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyUpperCaseCharactersText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyLowerCaseCharacters"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyLowerCaseCharactersIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyLowerCaseCharactersText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyMinSpecialCharacters"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinSpecialCharactersIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinSpecialCharactersText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyMaxCharacters"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMaxCharactersIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMaxCharactersText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareViaLinkPasswordPolicyMinDigits"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/standard_half_margin"
                    android:layout_marginRight="@dimen/standard_half_margin"
                    android:layout_gravity="center_horizontal"
                    android:orientation="horizontal"
                    android:visibility="gone">
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinDigitsIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
                    <TextView
                        android:id="@+id/shareViaLinkPasswordPolicyMinDigitsText"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

            <RelativeLayout
                android:id="@+id/shareViaLinkExpirationSection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_margin">

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/shareViaLinkExpirationSwitch"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentTop="true"
                    android:checked="false"
                    android:padding="@dimen/standard_half_padding" />

                <TextView
                    android:id="@+id/shareViaLinkExpirationLabel"
                    android:labelFor="@+id/shareViaLinkExpirationSwitch"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
                    android:paddingLeft="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/share_via_link_expiration_date_label"
                    android:textColor="@color/black"
                    android:textSize="15sp"
                    android:focusable="false"/>

                <TextView
                    android:id="@+id/shareViaLinkExpirationValue"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_below="@id/shareViaLinkExpirationLabel"
                    android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:textSize="12sp"
                    android:textColor="@color/list_item_lastmod_and_filesize_text"
                    android:visibility="gone"
                    android:focusable="false"/>

                <TextView
                    android:id="@+id/shareViaLinkExpirationExplanationLabel"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_below="@id/shareViaLinkExpirationValue"
                    android:paddingLeft="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/share_via_link_expiration_date_label"
                    android:textColor="@color/half_black"
                    android:textSize="15sp"
                    android:visibility="gone" />

            </RelativeLayout>

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

                <TextView
                    android:id="@+id/public_link_error_message"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:drawablePadding="5dp"
                    android:drawableStart="@drawable/common_error_grey"
                    android:gravity="center_vertical"
                    android:paddingLeft="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:textColor="@color/secondaryTextColor"
                    android:textSize="13sp"
                    android:visibility="gone" />

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

                    <androidx.appcompat.widget.AppCompatButton
                        android:id="@+id/cancelButton"
                        style="@style/Button.Primary"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:contentDescription="@string/share_cancel_public_link_button"
                        android:text="@string/share_cancel_public_link_button"
                        android:theme="@style/Button.Primary" />

                    <androidx.appcompat.widget.AppCompatButton
                        android:id="@+id/saveButton"
                        style="@style/Button.Primary"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:contentDescription="@string/share_confirm_public_link_button"
                        android:text="@string/share_confirm_public_link_button"
                        android:theme="@style/Button.Primary" />

                </LinearLayout>

            </LinearLayout>

        </LinearLayout>

    </ScrollView>

</LinearLayout>
