<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2024 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- The 2 placeholder views here are for vertical alignment purpose, in the file row it uses
     ratio-based layout for Name/Type/Size/Date columns but excluding the thumbnail icon and
     the preview icon. In order to make the header and row are vertically aligned, we need to
     use placeholder for thumbnail icon and preview icon and then do the ratio-based layout
     for table headers.
 -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/table_header"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="@dimen/doc_header_height_m3"
    android:baselineAligned="false"
    android:gravity="center_vertical"
    android:paddingStart="@dimen/main_container_padding_start"
    android:paddingEnd="@dimen/main_container_padding_end"
    android:visibility="gone">

    <!-- Column headers -->
    <com.lemenzo.files.sorting.HeaderCell
        android:id="@android:id/title"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.4"
        android:layout_marginEnd="12dp"
        android:clickable="true"
        android:focusable="false"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:animateLayoutChanges="true">

        <include layout="@layout/shared_cell_content_m3" />
    </com.lemenzo.files.sorting.HeaderCell>

    <com.lemenzo.files.sorting.HeaderCell
        android:id="@android:id/summary"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0"
        android:layout_marginEnd="0dp"
        android:clickable="true"
        android:focusable="false"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:animateLayoutChanges="true">

        <include layout="@layout/shared_cell_content_m3" />
    </com.lemenzo.files.sorting.HeaderCell>

    <com.lemenzo.files.sorting.HeaderCell
        android:id="@+id/file_type"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.2"
        android:clickable="true"
        android:focusable="false"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:animateLayoutChanges="true">

        <include layout="@layout/shared_cell_content_m3" />
    </com.lemenzo.files.sorting.HeaderCell>

    <com.lemenzo.files.sorting.HeaderCell
        android:id="@+id/size"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.2"
        android:clickable="true"
        android:focusable="false"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:animateLayoutChanges="true">

        <include layout="@layout/shared_cell_content_m3" />
    </com.lemenzo.files.sorting.HeaderCell>

    <com.lemenzo.files.sorting.HeaderCell
        android:id="@+id/date"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.2"
        android:clickable="true"
        android:focusable="false"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:animateLayoutChanges="true">

        <include layout="@layout/shared_cell_content_m3" />
    </com.lemenzo.files.sorting.HeaderCell>

    <!-- Placeholder for preview icon in picker mode, have the same size as @id/preview_icon in
         item_doc_list.xml, aim to align the file row columns with the able header columns.
     -->
    <View
        android:id="@+id/preview_icon_placeholder"
        android:layout_width="@dimen/list_item_icon_size"
        android:layout_height="@dimen/list_item_icon_size"
        android:layout_marginEnd="@dimen/list_item_icon_margin_end" />
</LinearLayout>