<?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.
-->
<!-- We used nested LinearLayouts here because it was harder to align the text vertically with
the center of the image using a single RelativeLayout. A ConstraintLayout could be a better
choice here, but it isn't available to us, yet. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="@dimen/context_menu_list_lateral_padding"
android:paddingEnd="@dimen/context_menu_list_lateral_padding">
<FrameLayout
android:id="@+id/menu_header_image_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/context_menu_header_vertical_padding"
android:layout_marginBottom="@dimen/context_menu_bottom_padding"
android:layout_marginEnd="16dp">
<!-- Circle background for when we have a favicon or monogram -->
<View
android:id="@+id/circle_background"
android:background="@drawable/context_menu_header_circle_bg"
android:layout_width="@dimen/context_menu_header_circle_bg_diameter"
android:layout_height="@dimen/context_menu_header_circle_bg_diameter"
android:layout_margin="@dimen/context_menu_header_circle_bg_margin"
android:visibility="invisible" />
<ImageView
android:id="@+id/menu_header_image"
android:layout_width="@dimen/context_menu_header_image_max_size"
android:layout_height="@dimen/context_menu_header_image_max_size"
android:scaleType="centerInside"
android:importantForAccessibility="no"
android:src="@color/thumbnail_placeholder_on_primary_bg" />
</FrameLayout>
<LinearLayout
android:id="@+id/title_and_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:paddingTop="@dimen/context_menu_header_vertical_padding"
android:paddingBottom="@dimen/context_menu_bottom_padding">
<org.chromium.ui.widget.TextViewWithLeading
android:id="@+id/menu_header_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.TextSmall.Primary"
app:leading="@dimen/text_size_small_leading" />
<org.chromium.ui.widget.TextViewWithLeading
android:id="@+id/menu_header_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textDirection="ltr"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
app:leading="@dimen/text_size_small_leading" />
</LinearLayout>
</LinearLayout>