<?xml version="1.0" encoding="utf-8"?>
<!--
  Nextcloud Android client application

  Copyright (C) 2018 Andy Scherzinger

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  License as published by the Free Software Foundation; either
  version 3 of the License, or any later version.

  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 AFFERO GENERAL PUBLIC LICENSE for more details.

  You should have received a copy of the GNU Affero General Public
  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView 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:layout_weight="1">

    <LinearLayout
        android:id="@+id/shareContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="@dimen/standard_eigth_padding">

        <androidx.appcompat.widget.SearchView
            android:id="@+id/searchView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/standard_eighth_margin"
            android:layout_marginLeft="@dimen/standard_eighth_margin"
            android:layout_marginEnd="@dimen/standard_margin"
            android:layout_marginRight="@dimen/standard_margin"
            android:hint="@string/share_search"
            style="@style/ownCloud.SearchView"/>

        <LinearLayout
            android:id="@+id/shared_with_you_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/standard_half_margin"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/standard_padding"
            android:paddingTop="@dimen/standard_padding"
            android:paddingRight="@dimen/standard_padding">

            <ImageView
                android:id="@+id/shared_with_you_avatar"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:contentDescription="@string/avatar"
                android:src="@drawable/ic_user" />

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

                <TextView
                    android:id="@+id/shared_with_you_username"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_padding"
                    android:text="@string/shared_with_you_by"
                    android:textSize="16sp"/>

                <TextView
                    android:id="@+id/shared_with_you_note"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_padding"
                    android:textSize="16sp"/>

            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/share_by_link_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/standard_half_margin"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/standard_padding"
            android:paddingTop="@dimen/standard_padding"
            android:paddingRight="@dimen/standard_padding">

            <com.google.android.flexbox.FlexboxLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                app:alignContent="stretch"
                app:alignItems="stretch"
                app:flexWrap="wrap">

                <androidx.appcompat.widget.AppCompatCheckBox
                    android:id="@+id/share_by_link"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="@string/share_via_link_section_title" />

                <ImageView
                    android:id="@+id/share_link_copy_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="32dp"
                    android:layout_gravity="start|center"
                    android:layout_weight="1"
                    android:contentDescription="@string/copy_link"
                    android:paddingStart="@dimen/standard_half_margin"
                    android:paddingLeft="@dimen/standard_half_margin"
                    android:paddingTop="@dimen/standard_quarter_margin"
                    android:paddingEnd="@dimen/standard_eighth_margin"
                    android:paddingRight="@dimen/standard_eighth_margin"
                    android:paddingBottom="@dimen/standard_quarter_margin"
                    android:scaleType="fitStart"
                    android:src="@drawable/ic_content_copy" />

                <androidx.appcompat.widget.AppCompatCheckBox
                    android:id="@+id/share_by_link_allow_editing"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:ellipsize="middle"
                    android:text="@string/edit_permission_label"
                    android:textSize="16sp" />
            </com.google.android.flexbox.FlexboxLayout>

            <ImageView
                android:id="@+id/overflow_menu_share_link"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="end|center"
                android:layout_marginStart="@dimen/standard_half_margin"
                android:layout_marginLeft="@dimen/standard_half_margin"
                android:layout_weight="0"
                android:contentDescription="@string/overflow_menu"
                android:paddingStart="@dimen/standard_half_padding"
                android:paddingLeft="@dimen/standard_half_padding"
                android:paddingEnd="@dimen/zero"
                android:paddingRight="@dimen/zero"
                android:src="@drawable/ic_dots_vertical"/>
        </LinearLayout>


        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/shareUsersList"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:divider="@drawable/divider"
            android:dividerHeight="1dp" />

        <TextView
            android:id="@+id/shareNoUsers"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="@dimen/standard_padding"
            android:paddingTop="@dimen/standard_half_padding"
            android:paddingRight="@dimen/standard_padding"
            android:text="@string/share_no_users"
            android:textSize="16sp" />

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

            <ImageView
                android:id="@+id/copy_internal_link_icon"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_gravity="center_horizontal"
                android:contentDescription="@string/share"
                android:src="@drawable/ic_external"
                android:paddingTop="@dimen/copy_internal_link_padding"
                android:paddingRight="@dimen/copy_internal_link_padding"
                android:paddingEnd="@dimen/copy_internal_link_padding"
                android:paddingBottom="@dimen/copy_internal_link_padding"
                android:paddingLeft="@dimen/copy_internal_link_padding"
                android:paddingStart="@dimen/copy_internal_link_padding"
                android:layout_marginBottom="@dimen/standard_half_margin"
                android:layout_marginEnd="@dimen/standard_margin"
                android:layout_marginLeft="@dimen/standard_margin"
                android:layout_marginRight="@dimen/standard_margin"
                android:layout_marginStart="@dimen/standard_margin"
                android:layout_marginTop="@dimen/standard_half_margin"
                android:background="@drawable/round_bgnd" />

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

                <TextView
                    android:id="@+id/shareInternalLink"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/text_color"
                    android:text="@string/share_internal_link" />

                <TextView
                    android:id="@+id/shareInternalLinkText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/share_internal_link_text" />
            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</ScrollView>
