<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 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"
style="@style/MaterialCardStyle">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.chromium.components.browser_ui.widget.async_image.AsyncImageView
android:id="@+id/thumbnail"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:layout_marginStart="16dp"
android:scaleType="centerCrop"
app:cornerRadiusTopStart="@dimen/download_manager_thumbnail_corner_radius"
app:cornerRadiusTopEnd="@dimen/download_manager_thumbnail_corner_radius"
app:cornerRadiusBottomStart="@dimen/download_manager_thumbnail_corner_radius"
app:cornerRadiusBottomEnd="@dimen/download_manager_thumbnail_corner_radius"
style="@style/AsyncImageView"
tools:ignore="ContentDescription" />
<include layout="@layout/list_menu_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignTop="@id/thumbnail"
android:layout_alignParentEnd="true"
android:paddingTop="12dp" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/thumbnail"
android:layout_toStartOf="@+id/more"
android:layout_marginStart="16dp"
android:layout_alignTop="@id/thumbnail"
android:minHeight="40dp"
android:maxLines="2"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextLarge.Primary"
android:textAlignment="viewStart"
app:layout_gravity="fill_horizontal" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/thumbnail"
android:layout_alignBottom="@id/thumbnail"
android:layout_marginStart="16dp"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
android:textAlignment="viewStart" />
<org.chromium.ui.widget.ChromeImageView
android:id="@+id/media_button"
style="@style/InlineOfflineIconStyle"
android:layout_alignBottom="@id/timestamp"
android:layout_toEndOf="@id/timestamp"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/thumbnail"
android:layout_above="@id/timestamp"
android:layout_marginStart="16dp"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
android:textAlignment="viewStart" />
<!-- 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="wrap_content"
app:layout_gravity="fill">
<org.chromium.chrome.browser.download.home.view.SelectionView
android:id="@+id/selection"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="24dp"
android:layout_marginStart="24dp"/>
</FrameLayout>
</RelativeLayout>
</org.chromium.components.browser_ui.widget.MaterialCardViewNoShadow>