<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/layout_receive_fragment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/fragment_receive_background"
        tools:context=".ui.fragment.ReceiveFragment">

        <!-- Shield Background -->
        <ImageView
            android:id="@+id/image_shield"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:scaleType="fitXY"
            app:srcCompat="@drawable/ic_shield"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
            app:layout_constraintDimensionRatio="H,1:1.1676"
            app:layout_constraintVertical_bias="0.062"
            app:layout_constraintWidth_default="percent"
            app:layout_constraintWidth_percent="0.84988" />

        <!-- QR code placeholder -->
        <ImageView
            android:id="@+id/receive_qr_code"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:scaleType="fitCenter"
            app:layout_constraintBottom_toBottomOf="@id/image_shield"
            app:layout_constraintDimensionRatio="H,1:1"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/image_shield"
            app:layout_constraintVertical_bias="0.272"
            app:layout_constraintWidth_default="percent"
            app:layout_constraintWidth_percent="0.59" />

        <ImageView
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:srcCompat="@drawable/ic_zcash_white"
            app:layout_constraintDimensionRatio="H,1:1"
            app:layout_constraintWidth_default="percent"
            app:layout_constraintWidth_percent="0.12"
            app:layout_constraintStart_toStartOf="@id/receive_qr_code"
            app:layout_constraintEnd_toEndOf="@id/receive_qr_code"
            app:layout_constraintTop_toTopOf="@id/receive_qr_code"
            app:layout_constraintBottom_toBottomOf="@id/receive_qr_code"
            />

        <View
            android:id="@+id/receive_address_background"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@color/zcashBlack_12"
            app:layout_constraintBottom_toBottomOf="@id/receive_address_parts"
            app:layout_constraintEnd_toEndOf="@id/image_shield"
            app:layout_constraintStart_toStartOf="@id/image_shield"
            app:layout_constraintTop_toTopOf="@id/receive_title" />

        <TextView
            android:id="@+id/receive_title"
            style="@style/Zcash.TextAppearance.Headline6"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="24dp"
            android:background="@color/receive_title_background"
            android:gravity="center"
            android:padding="16dp"
            android:text="@string/receive_address_title"
            android:textColor="@color/zcashWhite"
            app:layout_constraintEnd_toEndOf="@+id/image_shield"
            app:layout_constraintStart_toStartOf="@+id/image_shield"
            app:layout_constraintTop_toBottomOf="@+id/receive_qr_code" />


        <!-- Address parts -->

        <!-- Someday, there will be an advanced VirtualLayout that helps us do this without nesting but for now, this seems to be the only clean way to center all the fields -->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/receive_address_parts"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:foregroundGravity="center"
            android:padding="16dp"
            app:layout_constraintEnd_toEndOf="@id/receive_title"
            app:layout_constraintStart_toStartOf="@id/receive_title"
            app:layout_constraintTop_toBottomOf="@id/receive_title">
            <TextView
                android:id="@+id/text_address_part_1"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text=" ztestsaplin"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_3"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.0"
                app:layout_constraintVertical_chainStyle="packed" />

            <TextView
                android:id="@+id/text_address_part_3"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" jceuu9s2p6t"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_5"
                app:layout_constraintStart_toStartOf="@id/text_address_part_1"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_1" />

            <TextView
                android:id="@+id/text_address_part_5"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" 7u7uarqls7d"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_7"
                app:layout_constraintStart_toStartOf="@id/text_address_part_1"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_3" />

            <TextView
                android:id="@+id/text_address_part_7"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" rzq85xggu56"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="@id/text_address_part_1"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_5" />

            <TextView
                android:id="@+id/text_address_part_2"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginLeft="8dp"
                android:text=" g1mwjzlg62j"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_4"
                app:layout_constraintStart_toEndOf="@id/barrier_left_address_column"
                app:layout_constraintTop_toTopOf="@id/text_address_part_1" />

            <TextView
                android:id="@+id/text_address_part_4"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" wns6qxwec6v"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_6"
                app:layout_constraintStart_toStartOf="@id/text_address_part_2"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_2" />

            <TextView
                android:id="@+id/text_address_part_6"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" gtg3tpgqxjd"
                app:layout_constraintBottom_toTopOf="@+id/text_address_part_8"
                app:layout_constraintStart_toStartOf="@id/text_address_part_2"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_4" />

            <TextView
                android:id="@+id/text_address_part_8"
                style="@style/Zcash.TextAppearance.AddressPart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text=" k904xderng6"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="@id/text_address_part_2"
                app:layout_constraintTop_toBottomOf="@id/text_address_part_6" />

            <androidx.constraintlayout.widget.Barrier
                android:id="@+id/barrier_left_address_column"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="150dp"
                android:layout_marginRight="150dp"
                android:padding="150dp"
                app:barrierDirection="end"
                app:constraint_referenced_ids="text_address_part_1,text_address_part_3,text_address_part_5,text_address_part_7" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>