<?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"
    android:padding="16dp">

    <androidx.constraintlayout.widget.Group
        android:id="@+id/showState"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:constraint_referenced_ids="logout,fullname,photo,position,lastEntry,scan" />

    <ProgressBar
        android:id="@+id/loading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/photo"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:contentDescription="@null"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:src="@tools:sample/avatars" />

    <TextView
        android:id="@+id/fullname"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        android:textAppearance="@style/TextAppearance.AppCompat.Headline"
        app:layout_constraintEnd_toStartOf="@id/buttons"
        app:layout_constraintStart_toEndOf="@id/photo"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="@tools:sample/full_names" />

    <TextView
        android:id="@+id/position"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        app:layout_constraintEnd_toStartOf="@id/lastEntry"
        app:layout_constraintStart_toEndOf="@id/photo"
        app:layout_constraintTop_toBottomOf="@id/fullname"
        tools:text="@tools:sample/cities" />

    <TextView
        android:id="@+id/lastEntry"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        app:layout_constraintEnd_toStartOf="@id/buttons"
        app:layout_constraintStart_toEndOf="@id/position"
        app:layout_constraintTop_toTopOf="@id/position"
        tools:text="@tools:sample/date/hhmm" />

    <TextView
        android:id="@+id/error"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        android:textAlignment="center"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="Something wrong. Try later" />

    <androidx.constraintlayout.helper.widget.Flow
        android:id="@+id/buttons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:constraint_referenced_ids="logout,refresh"
        app:flow_horizontalGap="4dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/logout"
        style="?attr/floatingActionButtonSmallStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/profile_refresh_button"
        android:src="@drawable/ic_logout"
        app:elevation="0dp" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/refresh"
        style="?attr/floatingActionButtonSmallStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/profile_refresh_button"
        android:src="@drawable/ic_refresh"
        app:elevation="0dp" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/scan"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/profile_scan_button"
        android:src="@drawable/ic_qr_code"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:useCompatPadding="true" />
</androidx.constraintlayout.widget.ConstraintLayout>