<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <View
            android:layout_width="280dp"
            android:layout_height="1dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/accountEditDetailsHeader"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:text="@string/account_edit_header"
            android:textSize="21sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/accountEditDetailsNick"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="28dp"
            android:layout_marginEnd="24dp"
            android:hint="@string/account_edit_nick_hint"
            app:endIconMode="clear_text"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/accountEditDetailsHeader">

            <requestFocus />

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/accountEditDetailsNickText"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:inputType="textPersonName"
                android:maxLength="20" />
        </com.google.android.material.textfield.TextInputLayout>

        <TextView
            android:id="@+id/accountEditDetailsSecondHeader"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="28dp"
            android:layout_marginEnd="24dp"
            android:text="@string/account_edit_avatar_title"
            android:textSize="21sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/accountEditDetailsNick" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/account_edit_colors"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="14dp"
            android:layout_marginEnd="24dp"
            android:overScrollMode="never"
            android:scrollbars="none"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/accountEditDetailsSecondHeader"
            tools:itemCount="12"
            tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
            tools:listitem="@layout/item_account_edit_color"
            tools:spanCount="4" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/accountEditDetailsSave"
            style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_marginTop="36dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="8dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            android:minWidth="88dp"
            android:text="@string/all_save"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/account_edit_colors" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/accountEditDetailsCancel"
            style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_marginTop="36dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="8dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            android:minWidth="88dp"
            android:text="@android:string/cancel"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/accountEditDetailsSave"
            app:layout_constraintTop_toBottomOf="@id/account_edit_colors" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
