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

    <com.google.android.material.progressindicator.CircularProgressIndicator
        android:id="@+id/account_details_progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <LinearLayout
        android:id="@+id/account_details_error"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone"
        tools:ignore="UseCompoundDrawables"
        tools:visibility="gone">

        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:srcCompat="@drawable/ic_all_account"
            app:tint="?colorOnBackground"
            tools:ignore="contentDescription" />

        <TextView
            android:id="@+id/account_details_error_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:gravity="center"
            android:padding="8dp"
            android:text="@string/error_unknown"
            android:textSize="20sp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:gravity="center"
            android:orientation="horizontal">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/account_details_error_details"
                style="@style/Widget.Material3.Button.OutlinedButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:text="@string/all_details" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/account_details_error_retry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/all_retry" />
        </LinearLayout>
    </LinearLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/account_details_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        tools:visibility="visible">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:fillViewport="true"
            app:layout_constraintBottom_toTopOf="@id/accountDetailsSelect"
            app:layout_constraintTop_toTopOf="parent">

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

                <ImageView
                    android:id="@+id/accountDetailsAvatar"
                    android:layout_width="100dp"
                    android:layout_height="100dp"
                    android:layout_marginTop="36dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:ignore="ContentDescription"
                    tools:src="@tools:sample/avatars" />

                <com.mikhaellopez.circularimageview.CircularImageView
                    android:id="@+id/account_details_check"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginStart="70dp"
                    android:layout_marginTop="70dp"
                    app:civ_border_color="?colorSurface"
                    app:civ_border_width="1dp"
                    app:civ_circle_color="?colorSurface"
                    app:layout_constraintStart_toStartOf="@id/accountDetailsAvatar"
                    app:layout_constraintTop_toTopOf="@id/accountDetailsAvatar"
                    app:srcCompat="@drawable/ic_all_round_check"
                    app:tint="?colorPrimary" />

                <TextView
                    android:id="@+id/accountDetailsName"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="16dp"
                    android:layout_marginTop="16dp"
                    android:gravity="center_horizontal"
                    android:textSize="24sp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsAvatar"
                    tools:text="Jan Kowalski" />

                <TextView
                    android:id="@+id/accountDetailsSchool"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="16dp"
                    android:layout_marginTop="5dp"
                    android:gravity="center_horizontal"
                    android:textColor="?android:textColorSecondary"
                    android:textSize="14sp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsName"
                    tools:text="Szkoła FakeLog" />

                <LinearLayout
                    android:id="@+id/accountDetailsPersonalData"
                    android:layout_width="match_parent"
                    android:layout_height="56dp"
                    android:layout_marginTop="16dp"
                    android:background="?selectableItemBackground"
                    android:clickable="true"
                    android:focusable="true"
                    android:orientation="horizontal"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsSchool"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        app:srcCompat="@drawable/ic_all_account"
                        app:tint="?colorOnBackground"
                        tools:ignore="ContentDescription" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="32dp"
                        android:layout_marginEnd="16dp"
                        android:gravity="center_vertical"
                        android:text="@string/account_personal_data"
                        android:textSize="16sp" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/accountDetailsAddressData"
                    android:layout_width="match_parent"
                    android:layout_height="56dp"
                    android:background="?selectableItemBackground"
                    android:clickable="true"
                    android:focusable="true"
                    android:orientation="horizontal"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsPersonalData"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        app:srcCompat="@drawable/ic_all_home"
                        app:tint="?colorOnBackground"
                        tools:ignore="ContentDescription" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="32dp"
                        android:layout_marginEnd="16dp"
                        android:gravity="center_vertical"
                        android:text="@string/account_address"
                        android:textSize="16sp" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/accountDetailsContactData"
                    android:layout_width="match_parent"
                    android:layout_height="56dp"
                    android:background="?selectableItemBackground"
                    android:clickable="true"
                    android:focusable="true"
                    android:orientation="horizontal"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsAddressData"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        app:srcCompat="@drawable/ic_all_phone"
                        app:tint="?colorOnBackground"
                        tools:ignore="ContentDescription" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="32dp"
                        android:layout_marginEnd="16dp"
                        android:gravity="center_vertical"
                        android:text="@string/account_contact"
                        android:textSize="16sp" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/accountDetailsFamilyData"
                    android:layout_width="match_parent"
                    android:layout_height="56dp"
                    android:background="?selectableItemBackground"
                    android:clickable="true"
                    android:focusable="true"
                    android:orientation="horizontal"
                    app:layout_constraintTop_toBottomOf="@id/accountDetailsContactData"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        app:srcCompat="@drawable/ic_account_details_family"
                        app:tint="?colorOnBackground"
                        tools:ignore="ContentDescription" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="32dp"
                        android:layout_marginEnd="16dp"
                        android:gravity="center_vertical"
                        android:text="@string/account_family"
                        android:textSize="16sp" />
                </LinearLayout>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </ScrollView>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/accountDetailsSelect"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            android:text="@string/account_select_student"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintBottom_toTopOf="@id/accountDetailsLogout" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/accountDetailsLogout"
            style="@style/Widget.Material3.Button.OutlinedButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            android:text="@string/account_logout"
            app:layout_constraintBottom_toBottomOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
