<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<androidx.constraintlayout.widget.ConstraintLayout
    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">

    <!--
        Setting height to 0dp with the lottie JSON's intrinsic
        325:257 ratio (matching 'finds_opt_in_animation')
        ensures the height is calculated from the dynamically
        scaled width. This fixes a race condition where the sheet
        incorrectly allocates height before the asset loads,
        causing it to not fully peek.
    -->
    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/finds_opt_in_lottie_animation"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="8dp"
        android:importantForAccessibility="no"
        app:layout_constraintDimensionRatio="325:257"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:lottie_rawRes="@raw/finds_opt_in_animation"
        app:lottie_autoPlay="true"
        app:lottie_loop="true"/>

    <TextView
        android:id="@+id/opt_in_title_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:layout_marginHorizontal=
          "@dimen/finds_opt_in_bottom_sheet_horizontal_margin"
        android:textAppearance="@style/TextAppearance.Headline.Primary"
        android:gravity="center_horizontal|top"
        android:text="@string/chrome_finds_opt_in_bottom_sheet_title"
        android:accessibilityHeading="true"
        app:layout_constraintTop_toBottomOf=
          "@id/finds_opt_in_lottie_animation"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

    <org.chromium.ui.widget.TextViewWithLeading
        android:id="@+id/opt_in_description_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal=
          "@dimen/finds_opt_in_bottom_sheet_horizontal_margin"
        android:textAppearance=
          "@style/TextAppearance.TextMedium.Secondary"
        app:leading="@dimen/text_size_medium_leading"
        android:gravity="center_horizontal|top"
        android:text=
          "@string/chrome_finds_opt_in_bottom_sheet_description"
        app:layout_constraintTop_toBottomOf="@+id/opt_in_title_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

    <org.chromium.ui.widget.ButtonCompat
        android:id="@+id/opt_in_positive_button"
        style="@style/FilledButton"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal=
          "@dimen/finds_opt_in_bottom_sheet_horizontal_margin"
        android:layout_marginTop="24dp"
        android:text=
          "@string/chrome_finds_opt_in_bottom_sheet_positive_button_text"
        app:layout_constraintTop_toBottomOf="@+id/opt_in_description_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

    <org.chromium.ui.widget.ButtonCompat
        android:id="@+id/opt_in_negative_button"
        style="@style/TextButton"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal=
          "@dimen/finds_opt_in_bottom_sheet_horizontal_margin"
        android:text=
          "@string/chrome_finds_opt_in_bottom_sheet_negative_button_text"
        app:layout_constraintTop_toBottomOf="@+id/opt_in_positive_button"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
