<?xml version="1.0" encoding="UTF-8"?>

<!--
  Nextcloud Android client application

  Copyright (C) 2018 Tobias Kaminsky
  Copyright (C) 2018 Nextcloud

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/upload_list_item_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:baselineAligned="false"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/standard_half_padding"
    android:paddingTop="@dimen/standard_half_padding">

    <FrameLayout
        android:layout_width="@dimen/upload_list_item_frame_layout_width"
        android:layout_height="@dimen/standard_list_item_size"
        android:focusable="false"
        android:focusableInTouchMode="false">

        <ImageView
            android:id="@+id/thumbnail"
            android:layout_width="@dimen/file_icon_size"
            android:layout_height="@dimen/file_icon_size"
            android:layout_gravity="center"
            android:contentDescription="@null"
            android:src="@drawable/folder" />

    </FrameLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/upload_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:ellipsize="middle"
            android:singleLine="true"
            android:text="@string/placeholder_filename"
            android:textColor="@color/text_color"
            android:textSize="@dimen/two_line_primary_text_size" />


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

            <TextView
                android:id="@+id/upload_file_size"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="middle"
                android:gravity="start"
                android:singleLine="true"
                android:text="@string/placeholder_fileSize"
                android:textColor="@color/list_item_lastmod_and_filesize_text"
                android:textSize="@dimen/upload_list_item_text_size" />

            <TextView
                android:id="@+id/upload_date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/standard_quarter_margin"
                android:layout_marginStart="@dimen/standard_quarter_margin"
                android:text="@string/placeholder_timestamp"
                android:textColor="@color/list_item_lastmod_and_filesize_text"
                android:textSize="@dimen/upload_list_item_text_size" />

            <TextView
                android:id="@+id/upload_status"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/uploads_view_upload_status_succeeded"
                android:textColor="@color/list_item_lastmod_and_filesize_text"
                android:textSize="@dimen/upload_list_item_text_size" />

        </LinearLayout>

        <ProgressBar
            android:id="@+id/upload_progress_bar"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone" />

        <TextView
            android:id="@+id/upload_account"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxLines="1"
            android:textColor="@color/list_item_lastmod_and_filesize_text"
            android:textSize="@dimen/upload_list_item_text_size" />

        <TextView
            android:id="@+id/upload_remote_path"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="middle"
            android:singleLine="true"
            android:text="@string/instant_upload_path"
            android:textColor="@color/list_item_lastmod_and_filesize_text"
            android:textSize="@dimen/upload_list_item_text_size" />

    </LinearLayout>

    <FrameLayout
        android:layout_width="@dimen/min_list_item_size"
        android:layout_height="@dimen/standard_list_item_size"
        android:layout_gravity="center_vertical"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:paddingEnd="@dimen/zero"
        android:paddingStart="@dimen/standard_half_padding">

        <ImageButton
            android:id="@+id/upload_right_button"
            android:layout_width="@dimen/upload_list_item_image_size"
            android:layout_height="@dimen/upload_list_item_image_size"
            android:layout_gravity="center|end"
            android:background="@android:color/transparent"
            android:contentDescription="@string/upload_item_action_button" />
    </FrameLayout>

</LinearLayout>
