<?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.
-->
<merge 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">
<!-- Background outline shown when the tab is a drop target for drag & drop. -->
<org.chromium.ui.widget.ChromeImageView
android:id="@+id/background_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/tab_grid_card_background"
android:layout_margin="@dimen/tab_grid_card_margin"
android:visibility="gone"
android:importantForAccessibility="no" />
<!-- Main card content. -->
<FrameLayout
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@drawable/tab_grid_card_background"
android:layout_margin="@dimen/tab_grid_card_margin">
<ImageView
android:id="@+id/tab_favicon"
android:layout_height="@dimen/tab_grid_card_header_height"
android:layout_width="wrap_content"
android:minWidth="@dimen/tab_grid_card_favicon_padding"
android:adjustViewBounds="true"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/tab_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/tab_favicon"
android:layout_marginEnd="@dimen/tab_grid_card_title_end_margin"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="@dimen/tab_grid_card_title_fading_length"
android:minHeight="@dimen/tab_grid_card_header_height"
android:gravity="center_vertical"
android:ellipsize="none"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.TextMediumThick.Primary"/>
<org.chromium.chrome.browser.tab_ui.TabThumbnailView
android:id="@+id/tab_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tab_title"
android:layout_marginLeft="@dimen/tab_grid_card_thumbnail_margin"
android:layout_marginRight="@dimen/tab_grid_card_thumbnail_margin"
android:layout_marginBottom="@dimen/tab_grid_card_thumbnail_margin"
android:gravity="center_horizontal"
android:scaleType="fitCenter"
android:adjustViewBounds="false"
android:importantForAccessibility="no"
app:cornerRadiusTopStart="@dimen/tab_grid_card_thumbnail_corner_radius_top"
app:cornerRadiusTopEnd="@dimen/tab_grid_card_thumbnail_corner_radius_top"
app:cornerRadiusBottomStart="@dimen/tab_grid_card_thumbnail_corner_radius_bottom"
app:cornerRadiusBottomEnd="@dimen/tab_grid_card_thumbnail_corner_radius_bottom"/>
<!-- Legacy layout for price cards. To be removed in favor of tab_card_label. -->
<org.chromium.chrome.browser.tasks.tab_management.PriceCardView
android:id="@+id/price_info_box_outer"
android:layout_below="@id/tab_title"
android:background="@drawable/price_card_scrim"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="4dp"
android:visibility="gone"/>
<!-- New layout for labels including activity updates and price cards. -->
<ViewStub
android:id="@+id/tab_card_label_stub"
android:inflatedId="@+id/tab_card_label"
android:layout="@layout/tab_card_label_layout"
android:layout_width="wrap_content"
android:layout_height="@dimen/tab_card_label_height"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="11dp"/>
</RelativeLayout>
<!--
Close/Select button. This is outside the RelativeLayout so it can look like it is inside
the card while still fulfilling the minimum 48dp touch target size. ContentDescription is
set depending on what the content of this button is.
-->
<org.chromium.ui.widget.ChromeImageView
android:id="@+id/action_button"
android:layout_width="@dimen/tab_list_card_action_button_size"
android:layout_height="@dimen/tab_list_card_action_button_size"
android:layout_margin="@dimen/tab_list_card_action_button_margin"
android:scaleType="center"
android:layout_gravity="end"
android:tint="@macro/default_icon_color"
tools:ignore="ContentDescription" />
</FrameLayout>
</merge>