<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<org.chromium.components.browser_ui.widget.MaterialCardViewNoShadow
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:layout_width="match_parent"
android:layout_height="114dp"
android:clickable="true"
android:focusable="true"
style="@style/MaterialCardStyle">
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:columnCount="4"
app:rowCount="4">
<org.chromium.components.browser_ui.widget.async_image.AsyncImageView
android:id="@+id/thumbnail"
android:layout_width="113dp"
android:layout_height="112dp"
android:layout_marginEnd="9dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:layout_marginStart="1dp"
android:scaleType="centerCrop"
app:layout_column="0"
app:layout_row="0"
app:layout_rowSpan="4"
app:cornerRadiusTopStart="@dimen/card_rounded_corner_radius"
app:cornerRadiusBottomStart="@dimen/card_rounded_corner_radius"
style="@style/AsyncImageView"
tools:ignore="ContentDescription" />
<!-- Add a spacer so that even if the thumbnail is hidden the other elements
are still spaced correctly. This view matches the padding of the
thumbnail. -->
<Space
android:layout_width="10dp"
android:layout_height="114dp"
app:layout_column="0"
app:layout_row="0"
app:layout_rowSpan="4" />
<Space
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_gravity="fill"
app:layout_column="0"
app:layout_row="3"
app:layout_columnSpan="4" />
<org.chromium.ui.widget.TextViewWithLeading
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minHeight="40dp"
android:maxLines="2"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextLarge.Primary"
android:textAlignment="viewStart"
app:leading="@dimen/text_size_large_leading"
app:layout_column="1"
app:layout_row="0"
app:layout_columnSpan="2"
app:layout_gravity="fill_horizontal"/>
<TextView
android:id="@+id/caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
android:textAlignment="viewStart"
app:layout_column="1"
app:layout_row="1"
app:layout_columnSpan="3"
app:layout_gravity="fill_horizontal" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
android:textAlignment="viewStart"
app:layout_column="1"
app:layout_row="2"
app:layout_gravity="center_vertical" />
<ImageView
style="@style/InlineOfflineIconStyle"
app:srcCompat="@drawable/ic_offline_pin_24dp"
app:layout_column="2"
app:layout_row="2"
app:layout_columnSpan="2"
app:layout_gravity="start|center_vertical"
tools:ignore="ContentDescription" />
<include layout="@layout/list_menu_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:paddingTop="12dp"
app:layout_column="3"
app:layout_row="0" />
<!-- Wrap this in a FrameLayout so that if the thumbnail is hidden this view
does not negatively affect layout. The FrameLayout spans the whole
parent so it will not impact the rest of the views. -->
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_gravity="fill"
app:layout_column="0"
app:layout_row="0"
app:layout_columnSpan="4"
app:layout_rowSpan="4">
<org.chromium.chrome.browser.download.home.view.SelectionView
android:id="@+id/selection"
style="@style/DownloadItemSelectionView"/>
</FrameLayout>
</androidx.gridlayout.widget.GridLayout>
</org.chromium.components.browser_ui.widget.MaterialCardViewNoShadow>