<?xml version="1.0" encoding="utf-8"?>
<!--
  ownCloud Android client application
  Copyright (C) 2015 ownCloud Inc.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 2,
  as published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView android:id="@+id/shareScroll"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.owncloud.android.ui.fragment.ShareFileFragment">

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

        <RelativeLayout
            android:id="@+id/shareHeaderContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/standard_padding">

            <ImageView
                android:id="@+id/shareFileIcon"
                android:layout_width="@dimen/file_icon_size"
                android:layout_height="@dimen/file_icon_size"
                android:layout_gravity="center_vertical"
                android:layout_marginRight="@dimen/standard_half_margin"
                android:layout_marginEnd="@dimen/standard_half_margin"
                android:contentDescription="@null"
                android:src="@drawable/file"/>

            <TextView
                android:id="@+id/shareFileName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/standard_half_margin"
                android:layout_marginLeft="@dimen/standard_quarter_margin"
                android:layout_marginRight="@dimen/standard_half_margin"
                android:layout_marginStart="@dimen/standard_quarter_margin"
                android:layout_toEndOf="@+id/shareFileIcon"
                android:layout_toRightOf="@+id/shareFileIcon"
                android:ellipsize="middle"
                android:singleLine="true"
                android:text="@string/placeholder_filename"
                android:textColor="@color/text_color"
                android:textSize="@dimen/two_line_primary_text_size"/>

            <TextView
                android:id="@+id/shareFileSize"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/shareFileName"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="@dimen/standard_quarter_margin"
                android:layout_marginStart="@dimen/standard_quarter_margin"
                android:layout_toEndOf="@+id/shareFileIcon"
                android:layout_toRightOf="@+id/shareFileIcon"
                android:text="@string/placeholder_fileSize"
                android:textSize="@dimen/share_file_layout_text_size"/>

        </RelativeLayout>

        <View
            android:id="@+id/share_header_divider"
            android:layout_width="match_parent"
            android:layout_height="@dimen/standard_eighth_margin"
            android:background="@color/primary"
            />

        <LinearLayout
            android:id="@+id/shareWithUsersSection"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingLeft="@dimen/standard_padding"
            android:paddingRight="@dimen/standard_padding"
            android:paddingTop="@dimen/standard_padding"
            >

            <TextView
                android:id="@+id/shareWithUsersSectionTitle"
                style="@style/TextAppearance.AppCompat.Body2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:text="@string/share_with_user_section_title"
                android:textColor="@color/color_accent"/>

            <ListView
                android:id="@+id/shareUsersList"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:paddingStart="@dimen/standard_half_padding"
                android:paddingLeft="@dimen/standard_half_padding"
                android:paddingEnd="@dimen/standard_half_padding"
                android:paddingRight="@dimen/zero"
                android:scrollbars="vertical"
                android:visibility="gone"/>

            <TextView
                android:id="@+id/shareNoUsers"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="@dimen/standard_half_padding"
                android:text="@string/share_no_users"
                android:textSize="@dimen/share_file_layout_text_size"/>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/addUserButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:contentDescription="@string/share_add_user_or_group"
                android:text="@string/share_add_user_or_group"
                android:theme="@style/Button.Primary"
                app:cornerRadius="@dimen/button_corner_radius" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/shareViaLinkSection"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingBottom="@dimen/standard_padding"
            android:paddingLeft="@dimen/standard_padding"
            android:paddingRight="@dimen/standard_padding"
            >

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/shareViaLinkSectionSwitch"
                style="@style/TextAppearance.AppCompat.Body2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:checked="false"
                android:paddingRight="@dimen/standard_half_padding"
                android:paddingEnd="@dimen/standard_half_padding"
                android:paddingLeft="@dimen/zero"
                android:paddingStart="@dimen/zero"
                android:text="@string/share_via_link_section_title"
                android:textColor="@color/color_accent"/>

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

                <RelativeLayout
                    android:id="@+id/shareViaLinkEditPermissionSection"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone"
                    android:layout_marginBottom="@dimen/standard_half_margin"
                    >

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

                    <TextView
                        android:id="@+id/shareViaLinkEditPermissionLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_toLeftOf="@id/shareViaLinkEditPermissionSwitch"
                        android:layout_toStartOf="@id/shareViaLinkEditPermissionSwitch"
                        android:padding="@dimen/standard_half_padding"
                        android:text="@string/share_via_link_edit_permission_label"
                        android:textColor="@color/text_color"
                        android:textSize="14sp"
                        />

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/shareViaLinkHideFileListingPermissionSection"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone"
                    android:layout_marginBottom="@dimen/standard_half_margin"
                    >

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

                    <TextView
                        android:id="@+id/shareViaLinkFileListingPermissionLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_toLeftOf="@id/shareViaLinkFileListingPermissionSwitch"
                        android:layout_toStartOf="@id/shareViaLinkFileListingPermissionSwitch"
                        android:padding="@dimen/standard_half_padding"
                        android:text="@string/share_via_link_hide_file_listing_permission_label"
                        android:textColor="@color/text_color"
                        android:textSize="@dimen/two_line_secondary_text_size"
                        />

                </RelativeLayout>

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

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

                    <TextView
                        android:id="@+id/shareViaLinkPasswordLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
                        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/text_color"
                        android:textSize="@dimen/two_line_secondary_text_size"
                        />

                    <TextView
                        android:id="@+id/shareViaLinkPasswordValue"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_below="@id/shareViaLinkPasswordLabel"
                        android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
                        android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
                        android:paddingBottom="@dimen/standard_half_padding"
                        android:paddingLeft="@dimen/standard_half_padding"
                        android:paddingRight="@dimen/standard_half_padding"
                        android:text="@string/share_via_link_password_title"
                        android:textSize="@dimen/share_file_layout_text_size"
                        android:visibility="invisible"
                        />

                </RelativeLayout>

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

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

                    <TextView
                        android:id="@+id/shareViaLinkExpirationLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
                        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/text_color"
                        android:textSize="@dimen/two_line_secondary_text_size"
                        />

                    <TextView
                        android:id="@+id/shareViaLinkExpirationValue"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_below="@id/shareViaLinkExpirationLabel"
                        android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
                        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="@dimen/share_file_layout_text_size"
                        />

                </RelativeLayout>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/shareViaLinkGetLinkButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:contentDescription="@string/share_get_public_link_button"
                    android:text="@string/share_get_public_link_button"
                    android:theme="@style/Button.Primary"
                    app:cornerRadius="@dimen/button_corner_radius" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</ScrollView>
