<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<RelativeLayout
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent">

  <!-- Drag handlebar -->
  <ImageView
      android:id="@+id/handlebar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:paddingVertical="@dimen/secure_payment_confirmation_ui_drag_handle_spacing"
      android:importantForAccessibility="no"
      android:layout_centerHorizontal="true"
      android:src="@drawable/drag_handlebar" />

  <ScrollView
      android:id="@+id/scroll_view"
      android:layout_below="@id/handlebar"
      android:layout_height="wrap_content"
      android:layout_width="match_parent">

    <RelativeLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:textDirection="locale"
        android:paddingHorizontal="@dimen/secure_payment_confirmation_ui_large_padding"
        android:paddingTop="@dimen/secure_payment_confirmation_ui_small_padding"
        android:paddingBottom="@dimen/secure_payment_confirmation_ui_large_padding">

      <!-- Default header image -->
      <ImageView
          android:id="@+id/secure_payment_confirmation_header_illustration"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_small_padding"
          android:scaleType="centerInside"
          android:importantForAccessibility="no"
          android:src="@drawable/secure_payment_confirmation_header_illustration" />

      <!-- Header logos row -->
      <LinearLayout
          android:id="@+id/header_logos_row"
          android:layout_below="@id/secure_payment_confirmation_header_illustration"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:orientation="horizontal"
          android:gravity="center"
          android:layout_marginTop="@dimen/secure_payment_confirmation_ui_small_padding"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_large_padding"
          android:visibility="gone">

        <ImageView
            android:id="@+id/header_logo_primary"
            android:layout_height="@dimen/secure_payment_confirmation_ui_header_logo_height"
            android:layout_width="@dimen/secure_payment_confirmation_ui_header_logo_width"
            android:scaleType="fitEnd"
            android:contentDescription="@string/secure_payment_confirmation_header_logo_primary"/>

        <View
            style="@style/VerticalDivider"
            android:id="@+id/header_logos_divider"
            android:layout_marginHorizontal="@dimen/secure_payment_confirmation_ui_medium_padding"/>

        <ImageView
            android:id="@+id/header_logo_secondary"
            android:layout_height="@dimen/secure_payment_confirmation_ui_header_logo_height"
            android:layout_width="@dimen/secure_payment_confirmation_ui_header_logo_width"
            android:scaleType="fitStart"
            android:contentDescription="@string/secure_payment_confirmation_header_logo_secondary"/>
      </LinearLayout>

      <!-- SPC bottom sheet title -->
      <TextView
          android:id="@+id/secure_payment_confirmation_title"
          android:layout_below="@id/header_logos_row"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_medium_padding"
          android:textAppearance="@style/TextAppearance.Headline.Primary"
          android:includeFontPadding="false"
          tools:text="Verify"/>

      <!-- List of item rows for SPC (includes "Store", "Payment", and "Total") -->
      <androidx.recyclerview.widget.RecyclerView
          android:id="@+id/item_list"
          android:layout_below="@id/secure_payment_confirmation_title"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:divider="@null"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_medium_padding"
          tools:listitem="@layout/list_item"/>

      <!-- Opt Out text, if requested by SPC caller -->
      <org.chromium.ui.widget.TextViewWithClickableSpans
          android:id="@+id/secure_payment_confirmation_nocredmatch_opt_out"
          android:layout_below="@id/item_list"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:gravity="center"
          android:layout_marginHorizontal="@dimen/secure_payment_confirmation_ui_small_padding"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_medium_padding"
          android:textAppearance="@style/TextAppearance.TextSmall.Secondary"/>

      <!-- Footnote text including a clickable link to "verify another way" -->
      <org.chromium.ui.widget.TextViewWithClickableSpans
          android:id="@+id/secure_payment_confirmation_footnote"
          android:layout_below="@id/secure_payment_confirmation_nocredmatch_opt_out"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:gravity="center"
          android:layout_marginHorizontal="@dimen/secure_payment_confirmation_ui_small_padding"
          android:layout_marginBottom="@dimen/secure_payment_confirmation_ui_medium_padding"
          android:textAppearance="@style/TextAppearance.TextSmall.Secondary"/>

      <!-- Continue button -->
      <org.chromium.ui.widget.ButtonCompat
          android:id="@+id/continue_button"
          android:layout_below="@id/secure_payment_confirmation_footnote"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          tools:text="Verify"
          style="@style/FilledButton"/>
    </RelativeLayout>
  </ScrollView>
</RelativeLayout>
