<?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">

    <!-- Source: https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=2857%3A321 -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/showUserCodeToolBar"
                android:layout_width="match_parent"
                android:layout_height="?actionBarSize"
                app:title="@string/add_by_qr_code"/>

        </com.google.android.material.appbar.AppBarLayout>

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/showUserCodeCard"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="81dp"
            android:padding="16dp"
            app:cardCornerRadius="8dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/appBarLayout"
            app:layout_constraintWidth_percent="0.8">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:id="@+id/showUserCodeCardNameText"
                    style="@style/Widget.Vector.TextView.Subtitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:layout_marginTop="50dp"
                    android:layout_marginEnd="16dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textAlignment="center"
                    android:textColor="?vctr_content_primary"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="@sample/users.json/data/displayName" />

                <TextView
                    android:id="@+id/showUserCodeCardUserIdText"
                    style="@style/Widget.Vector.TextView.Body"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:layout_marginTop="4dp"
                    android:layout_marginEnd="16dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textAlignment="center"
                    android:textColor="?vctr_content_tertiary"
                    app:layout_constraintTop_toBottomOf="@id/showUserCodeCardNameText"
                    tools:text="@sample/users.json/data/id" />

                <!--                android:id="@+id/itemShareQrCodeImage"-->
                <!--                android:layout_width="300dp"-->
                <!--                android:layout_height="300dp"-->
                <!--                android:layout_gravity="center_horizontal"-->
                <!--                android:contentDescription="@string/a11y_qr_code_for_verification"-->
                <!--                tools:src="@color/vctr_header_panel_background_black" />-->

                <com.google.android.material.card.MaterialCardView
                    android:layout_width="200dp"
                    android:layout_height="200dp"
                    android:layout_marginTop="16dp"
                    android:layout_marginBottom="32dp"
                    android:backgroundTint="@color/palette_white"
                    app:cardCornerRadius="8dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/showUserCodeCardUserIdText"
                    app:layout_constraintWidth_percent="0.8">

                    <im.vector.app.core.ui.views.QrCodeImageView
                        android:id="@+id/showUserCodeQRImage"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:contentDescription="@string/a11y_qr_code_for_verification"
                        tools:src="@drawable/ic_qr_code_add" />

                </com.google.android.material.card.MaterialCardView>

            </androidx.constraintlayout.widget.ConstraintLayout>

        </com.google.android.material.card.MaterialCardView>

        <ImageView
            android:id="@+id/showUserCodeAvatar"
            android:layout_width="76dp"
            android:layout_height="76dp"
            android:importantForAccessibility="no"
            android:elevation="4dp"
            android:transitionName="profile"
            app:layout_constraintBottom_toTopOf="@id/showUserCodeCard"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/showUserCodeCard"
            tools:src="@sample/user_round_avatars" />

        <TextView
            android:id="@+id/showUserCodeInfoText"
            style="@style/Widget.Vector.TextView.Body"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="16dp"
            android:text="@string/user_code_info_text"
            android:textAlignment="center"
            android:textColor="?vctr_content_primary"
            app:layout_constraintEnd_toEndOf="@id/showUserCodeCard"
            app:layout_constraintStart_toStartOf="@id/showUserCodeCard"
            app:layout_constraintTop_toBottomOf="@id/showUserCodeCard" />

        <Button
            android:id="@+id/showUserCodeShareButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="24dp"
            android:minWidth="130dp"
            android:text="@string/user_code_share"
            app:icon="@drawable/ic_share"
            app:iconTint="?colorOnPrimary"
            app:layout_constraintBottom_toTopOf="@id/showUserCodeScanButton"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/showUserCodeInfoText"
            app:layout_constraintVertical_bias="0"
            tools:ignore="MissingPrefix" />

        <Button
            android:id="@+id/showUserCodeScanButton"
            style="@style/Widget.Vector.Button.Text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/layout_vertical_margin"
            android:minWidth="130dp"
            android:text="@string/user_code_scan"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/showUserCodeShareButton"
            app:layout_constraintVertical_bias="0" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>
