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

    <io.github.wulkanowy.ui.widgets.FittedScrollableTabLayout
        android:id="@+id/gradeTabLayout"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:background="?colorSurface"
        android:visibility="invisible"
        android:outlineProvider="none"
        app:tabMode="scrollable"
        app:tabSelectedTextColor="?colorPrimary"
        app:tabTextColor="@color/material_on_surface_emphasis_medium"
        tools:ignore="UnusedAttribute"
        tools:visibility="visible" />

    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/gradeViewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="48dp"
        android:visibility="invisible"
        tools:visibility="visible" />

    <com.google.android.material.progressindicator.CircularProgressIndicator
        android:id="@+id/gradeProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminate="true"
        tools:visibility="invisible" />

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

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

        <TextView
            android:id="@+id/gradeErrorMessage"
            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/gradeErrorDetails"
                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/gradeErrorRetry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/all_retry" />
        </LinearLayout>
    </LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
