<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">

    <org.thoughtcrime.securesms.util.views.DarkOverflowToolbar
        android:id="@+id/vector_avatar_creation_toolbar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        android:theme="?attr/settingsToolbarStyle"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_arrow_left_24"
        app:title="@string/TextAvatarCreationFragment__preview"
        app:titleTextAppearance="@style/Signal.Text.Title" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@id/vector_avatar_creation_toolbar">

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/avatar_picker_image_wrapper"
                android:layout_width="match_parent"
                android:layout_height="240dp"
                app:layout_constraintBottom_toTopOf="@id/vector_avatar_creation_divider"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_chainStyle="spread_inside">

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/vector_avatar_creation_image"
                    android:layout_width="@dimen/avatar_picker_image_width"
                    android:layout_height="@dimen/avatar_picker_image_width"
                    android:layout_marginTop="24dp"
                    android:background="@drawable/circle_tintable"
                    android:contentDescription="@string/AvatarPickerFragment__avatar_preview"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:backgroundTint="#DEE3FF" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <View
                android:id="@+id/vector_avatar_creation_divider"
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:layout_marginTop="32dp"
                android:layout_marginBottom="16dp"
                android:background="@color/signal_inverse_transparent_05"
                app:layout_constraintBottom_toTopOf="@id/vector_avatar_creation_header"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_image_wrapper"
                app:layout_constraintVertical_bias="1"
                app:layout_constraintVertical_chainStyle="packed" />

            <TextView
                android:id="@+id/vector_avatar_creation_header"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="56dp"
                android:paddingStart="@dimen/dsl_settings_gutter"
                android:paddingTop="24dp"
                android:paddingEnd="@dimen/dsl_settings_gutter"
                android:paddingBottom="12dp"
                android:text="@string/VectorAvatarCreationFragment__select_a_color"
                android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
                app:layout_constraintBottom_toTopOf="@id/vector_avatar_creation_recycler"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/vector_avatar_creation_divider" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/vector_avatar_creation_recycler"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginStart="@dimen/dsl_settings_gutter"
                android:layout_marginEnd="@dimen/dsl_settings_gutter"
                android:clipChildren="false"
                android:clipToPadding="false"
                android:overScrollMode="never"
                android:paddingBottom="80dp"
                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHeight_max="326dp"
                app:layout_constraintHeight_min="160dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/vector_avatar_creation_header"
                app:spanCount="4"
                tools:listitem="@layout/avatar_picker_item" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>

    <com.google.android.material.button.MaterialButton
        android:id="@+id/vector_avatar_creation_done"
        style="@style/Signal.Widget.Button.Large.Tonal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:text="@string/TextAvatarCreationFragment__done"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>