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

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

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

            <com.google.android.material.imageview.ShapeableImageView
                android:id="@+id/avatar_picker_item_image"
                android:layout_width="@dimen/avatar_picker_image_width"
                android:layout_height="@dimen/avatar_picker_image_width"
                android:layout_marginTop="?actionBarSize"
                android:background="@drawable/circle_tintable"
                android:contentDescription="@string/AvatarPickerFragment__avatar_preview"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
                tools:backgroundTint="#DEE3FF" />

            <org.thoughtcrime.securesms.components.emoji.EmojiTextView
                android:id="@+id/avatar_picker_item_text"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:fontFamily="sans-serif-medium"
                android:gravity="center"
                app:layout_constraintBottom_toBottomOf="@id/avatar_picker_item_image"
                app:layout_constraintEnd_toEndOf="@id/avatar_picker_item_image"
                app:layout_constraintStart_toStartOf="@id/avatar_picker_item_image"
                app:layout_constraintTop_toTopOf="@id/avatar_picker_item_image"
                app:emoji_forceCustom="true"
                app:emoji_forceJumbo="true"
                tools:ignore="SpUsage"
                tools:text="AF" />

            <org.thoughtcrime.securesms.components.ButtonStripItemView
                android:id="@+id/avatar_picker_camera"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="32dp"
                app:bsiv_icon="@drawable/ic_camera_24"
                app:bsiv_icon_contentDescription="@string/AvatarPickerFragment__take_a_picture"
                app:bsiv_label="@string/AvatarPickerFragment__camera"
                app:layout_constraintEnd_toStartOf="@id/avatar_picker_photo"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_item_image" />

            <org.thoughtcrime.securesms.components.ButtonStripItemView
                android:id="@+id/avatar_picker_photo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="32dp"
                app:bsiv_icon="@drawable/ic_photo_24"
                app:bsiv_icon_contentDescription="@string/AvatarPickerFragment__choose_a_photo"
                app:bsiv_label="@string/AvatarPickerFragment__photo"
                app:layout_constraintEnd_toStartOf="@id/avatar_picker_text"
                app:layout_constraintStart_toEndOf="@id/avatar_picker_camera"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_item_image" />

            <org.thoughtcrime.securesms.components.ButtonStripItemView
                android:id="@+id/avatar_picker_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="32dp"
                app:bsiv_icon="@drawable/ic_text_24"
                app:bsiv_icon_contentDescription="@string/AvatarPickerFragment__text"
                app:bsiv_label="@string/AvatarPickerFragment__text"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@id/avatar_picker_photo"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_item_image" />

            <View
                android:id="@+id/avatar_picker_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_constraintTop_toBottomOf="@id/avatar_picker_photo" />

            <TextView
                android:id="@+id/avatar_picker_select_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/AvatarPickerFragment__select_an_avatar"
                android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_divider" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/avatar_picker_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:paddingBottom="80dp"
                android:overScrollMode="never"
                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHeight_min="160dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/avatar_picker_select_header"
                app:spanCount="4"
                tools:listitem="@layout/avatar_picker_item" />

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/avatar_picker_clear"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:layout_marginEnd="4dp"
                android:contentDescription="@string/AvatarPickerFragment__clear_avatar"
                android:visibility="gone"
                app:backgroundTint="@color/signal_background_primary"
                app:fabSize="mini"
                app:layout_constraintEnd_toEndOf="@id/avatar_picker_item_image"
                app:layout_constraintTop_toTopOf="@id/avatar_picker_item_image"
                app:srcCompat="@drawable/ic_x_20"
                tools:visibility="visible" />

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

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/avatar_picker_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?actionBarSize"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_x_tinted" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/avatar_picker_save"
        style="@style/Signal.Widget.Button.Large.Primary"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:alpha="0.5"
        android:enabled="false"
        android:minHeight="48dp"
        android:text="@string/AvatarPickerFragment__save"
        app:cornerRadius="28dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>