<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!-- This XML should not be inflated by anything except PromoDialog.java.
This layout is deeply nested to account for the various bits having to flop orientations
in landscape. If these become more frequently used, we should investigate optimizing the
layout.
-->
<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">
<org.chromium.components.browser_ui.widget.PromoDialogLayout
android:id="@+id/promo_dialog_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:background="@drawable/menu_bg_tinted"
app:maxWidthLandscape="@dimen/dialog_max_width"
app:maxWidthPortrait="@dimen/dialog_max_width" >
<org.chromium.components.browser_ui.widget.FadingEdgeScrollView
android:id="@+id/promo_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fadeScrollbars="false" >
<!-- This layout pivots when the dialog is wider than it is tall. -->
<LinearLayout
android:id="@+id/full_promo_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/promo_dialog_padding"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="@+id/illustration"
android:layout_width="@dimen/promo_dialog_illustration_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="@dimen/promo_dialog_illustration_margin"
android:layout_marginStart="@dimen/promo_dialog_illustration_margin"
android:layout_marginEnd="@dimen/promo_dialog_illustration_margin"
android:scaleType="fitCenter"
tools:ignore="ContentDescription" />
<org.chromium.components.browser_ui.widget.BoundedLinearLayout
android:id="@+id/scrollable_promo_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:maxWidthLandscape="@dimen/promo_dialog_max_content_width"
app:maxWidthPortrait="@dimen/promo_dialog_max_content_width" >
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textDirection="locale"
android:layout_marginTop="@dimen/dialog_header_margin"
android:layout_marginBottom="@dimen/dialog_header_margin"
android:textAppearance="@style/TextAppearance.Headline.Primary" />
<org.chromium.ui.widget.TextViewWithClickableSpans
android:id="@+id/subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textDirection="locale"
app:leading="@dimen/text_size_medium_leading"
style="@style/TextAppearance.TextMedium.Secondary" />
</org.chromium.components.browser_ui.widget.BoundedLinearLayout>
</LinearLayout>
</org.chromium.components.browser_ui.widget.FadingEdgeScrollView>
<ViewStub
android:id="@+id/footer_stub"
android:layout="@layout/dialog_control_description"
android:inflatedId="@+id/footer"
android:layout_margin="@dimen/promo_dialog_padding"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<org.chromium.components.browser_ui.widget.DualControlLayout
android:id="@+id/button_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:padding="@dimen/promo_dialog_padding"
app:buttonAlignment="end"
app:stackedMargin="@dimen/promo_dialog_stacked_margin" />
</org.chromium.components.browser_ui.widget.PromoDialogLayout>
</merge>