<!--
  ~ Nextcloud - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2023 Alper Ozturk <alper.ozturk@nextcloud.com>
  ~ SPDX-FileCopyrightText: 2014-2022 Tobias Kaminsky <tobias@kaminsky.me>
  ~ SPDX-FileCopyrightText: 2020 Abdourahamane Boinaidi <abdourahamane.boinaidi@infomaniak.com>
  ~ SPDX-FileCopyrightText: 2016-2017 Andy Scherzinger <info@andy-scherzinger.de>
  ~ SPDX-FileCopyrightText: 2015 ownCloud Inc.
  ~ SPDX-License-Identifier: GPL-2.0-only AND (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:id="@+id/ListItemLayout"
    android:layout_width="match_parent"
    android:layout_height="@dimen/grid_container_height"
    android:layout_margin="@dimen/grid_container_margin">

    <com.elyeproj.loaderviewlibrary.LoaderImageView
        android:id="@+id/thumbnail_shimmer"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:contentDescription="@null"
        android:src="@drawable/folder"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/thumbnail"
        app:layout_constraintEnd_toEndOf="@id/thumbnail"
        app:layout_constraintStart_toStartOf="@id/thumbnail"
        app:layout_constraintTop_toTopOf="@id/thumbnail"
        tools:visibility="visible" />

    <com.owncloud.android.ui.SquareImageView
        android:id="@+id/thumbnail"
        android:layout_width="@dimen/standard_list_item_size"
        android:layout_height="@dimen/standard_list_item_size"
        android:layout_marginTop="@dimen/standard_half_margin"
        android:contentDescription="@null"
        android:src="@drawable/folder"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="visible" />

    <LinearLayout
        android:id="@+id/file_features_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:alpha="0.9"
        android:background="@drawable/rounded_rect"
        android:backgroundTint="@color/grid_file_features_background_color"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="@dimen/standard_quarter_padding"
        android:translationZ="4dp"
        app:layout_constraintBottom_toBottomOf="@+id/thumbnail"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.85"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.85">

        <ImageView
            android:id="@+id/favorite_action"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:contentDescription="@string/favorite_icon"
            android:src="@drawable/favorite"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/videoOverlay"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:contentDescription="@string/video_overlay_icon"
            android:src="@drawable/video_white"
            android:visibility="gone"
            app:tint="@color/grid_file_features_icon_color"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/sharedIcon"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:contentDescription="@string/shared_icon_shared_via_link"
            android:src="@drawable/shared_via_link"
            app:tint="@color/grid_file_features_icon_color"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/unreadComments"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:clickable="true"
            android:contentDescription="@string/unread_comments"
            android:focusable="true"
            android:src="@drawable/ic_comment_grid"
            android:visibility="gone"
            app:tint="@color/grid_file_features_icon_color"
            tools:ignore="TouchTargetSizeCheck"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/grid_live_photo_indicator"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:clickable="true"
            android:contentDescription="@string/grid_file_features_live_photo_content_description"
            android:focusable="true"
            android:src="@drawable/ic_live_photo"
            android:visibility="gone"
            app:tint="@color/grid_file_features_icon_color"
            tools:ignore="TouchTargetSizeCheck"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/localFileIndicator"
            android:layout_width="@dimen/grid_layout_item_size"
            android:layout_height="@dimen/grid_layout_item_size"
            android:layout_marginEnd="@dimen/grid_layout_margin_end"
            android:contentDescription="@string/synced_icon"
            android:src="@drawable/ic_synced"
            tools:visibility="visible" />

    </LinearLayout>

    <ImageView
        android:id="@+id/custom_checkbox"
        android:layout_width="@dimen/grid_checkbox_size"
        android:layout_height="@dimen/grid_checkbox_size"
        android:layout_marginStart="@dimen/grid_checkbox_margin"
        android:layout_marginTop="@dimen/grid_checkbox_margin"
        android:contentDescription="@string/checkbox"
        android:src="@android:drawable/checkbox_off_background"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="visible" />

    <LinearLayout
        tools:visibility="visible"
        android:id="@+id/bidi_filename_container"
        android:layout_width="match_parent"
        android:layout_height="@dimen/grid_bottom_view_height"
        android:visibility="gone"
        android:gravity="center"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/thumbnail">

        <LinearLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_marginStart="@dimen/iconized_single_line_item_icon_size"
            android:layout_gravity="center"
            android:gravity="center"
            android:layout_height="match_parent">

            <TextView
                android:id="@+id/bidi_filename"
                android:layout_width="wrap_content"
                android:maxWidth="@dimen/grid_container_default_max_file_name"
                android:layout_height="match_parent"
                android:ellipsize="end"
                android:gravity="center"
                android:maxLines="1"
                android:text="@string/placeholder_filename"
                android:textSize="@dimen/grid_item_text_size" />

            <TextView
                android:id="@+id/bidi_extension"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:ellipsize="start"
                android:gravity="center"
                android:maxLines="1"
                android:text="@string/placeholder_extension"
                android:textSize="@dimen/grid_item_text_size" />

        </LinearLayout>

        <ImageButton
            android:id="@+id/bidi_more"
            android:layout_width="@dimen/iconized_single_line_item_icon_size"
            android:layout_height="match_parent"
            android:background="@color/transparent"
            android:contentDescription="@string/overflow_menu"
            android:translationZ="2dp"
            app:srcCompat="@drawable/ic_dots_vertical"
            tools:ignore="TouchTargetSizeCheck" />
    </LinearLayout>


    <TextView
        android:id="@+id/Filename"
        android:layout_width="0dp"
        android:layout_height="@dimen/grid_bottom_view_height"
        android:layout_gravity="center"
        android:ellipsize="middle"
        android:gravity="center"
        android:singleLine="true"
        android:text="@string/placeholder_filename"
        android:textSize="@dimen/grid_item_text_size"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/thumbnail"
        app:layout_constraintWidth_percent="0.75"
        tools:visibility="visible" />

    <ImageButton
        android:id="@+id/more"
        android:layout_width="24dp"
        android:layout_height="@dimen/grid_bottom_view_height"
        android:layout_gravity="center"
        android:background="@color/transparent"
        android:contentDescription="@string/overflow_menu"
        android:translationZ="2dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/Filename"
        app:layout_constraintTop_toBottomOf="@id/thumbnail"
        app:srcCompat="@drawable/ic_dots_vertical"
        tools:ignore="TouchTargetSizeCheck"
        tools:visibility="visible" />


</androidx.constraintlayout.widget.ConstraintLayout>