<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView 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="wrap_content"
    android:layout_marginStart="@dimen/marginNormal"
    android:layout_marginTop="@dimen/marginClose"
    android:layout_marginEnd="@dimen/marginNormal"
    android:layout_marginBottom="@dimen/marginSmall"
    app:cardBackgroundColor="?colorSurface"
    app:contentPaddingBottom="@dimen/marginNormal"
    app:contentPaddingTop="@dimen/marginNormal">

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

        <LinearLayout
            android:id="@+id/stats_label_layout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/marginNormal"
            android:layout_marginEnd="@dimen/marginNormal"
            android:gravity="center_vertical"
            app:layout_constraintEnd_toStartOf="@id/stats_mean_score_layout"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/stats_rank_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/marginNormal"
                android:visibility="gone"
                tools:visibility="visible">

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_rank_text"
                    android:layout_width="wrap_content"
                    android:layout_height="0dp"
                    android:background="@drawable/oval"
                    android:backgroundTint="#E5C07B"
                    android:gravity="center"
                    android:padding="@dimen/marginSmall"
                    android:textColor="@color/black"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintDimensionRatio="1:1"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="100." />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/stats_label_sublayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:gravity="center_vertical">

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/logo_container"
                    android:layout_width="24sp"
                    android:layout_height="24sp"
                    android:layout_marginEnd="6dp"
                    android:visibility="gone"
                    tools:visibility="visible"
                    app:cardBackgroundColor="#2E51A2"
                    app:cardCornerRadius="4dp"
                    app:cardElevation="0dp"
                    app:layout_constraintEnd_toStartOf="@id/stats_label_text"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintHorizontal_chainStyle="packed"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:strokeWidth="0dp">

                    <ImageView
                        android:id="@+id/logo_icon"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:importantForAccessibility="no"
                        android:padding="2dp"
                        tools:src="@drawable/ic_tracker_mal" />

                </com.google.android.material.card.MaterialCardView>

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_label_text"
                    style="?textAppearanceLabelLarge"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintStart_toEndOf="@id/logo_container"
                    app:layout_constraintBottom_toTopOf="@id/stats_sublabel_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    tools:text="MANGA" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_sublabel_text"
                    style="?textAppearanceLabelMedium"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="@id/stats_label_text"
                    app:layout_constraintTop_toBottomOf="@id/stats_label_text"
                    tools:text="Mangadex (FR)" />
            </androidx.constraintlayout.widget.ConstraintLayout>

        </LinearLayout>

        <LinearLayout
            android:id="@+id/stats_mean_score_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end"
            android:layout_marginEnd="@dimen/marginNormal"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@id/stats_label_layout"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/stats_label_layout"
            tools:visibility="visible">

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/stats_score_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:includeFontPadding="false"
                android:textSize="16sp"
                tools:text="0" />

            <ImageView
                android:id="@+id/stats_score_star_image"
                android:layout_width="14dp"
                android:layout_height="14dp"
                android:layout_gravity="center"
                android:layout_marginStart="2dp"
                android:contentDescription="@string/mean_tracking_score"
                android:src="@drawable/ic_star_12dp"
                app:tint="?attr/colorOnBackground" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/stats_data_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/marginNormal"
            android:layout_marginTop="@dimen/marginNormal"
            android:layout_marginEnd="@dimen/marginNormal"
            android:baselineAligned="false"
            app:layout_constraintTop_toBottomOf="@id/stats_label_layout">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">

                <com.google.android.material.textview.MaterialTextView
                    style="?textAppearanceLabelMedium"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/count" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_count_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/marginClose"
                    tools:text="0" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_count_percentage_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/marginClose"
                    tools:text="(10%)" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/marginNormal"
                android:layout_weight="2"
                android:orientation="vertical">

                <com.google.android.material.textview.MaterialTextView
                    style="?textAppearanceLabelMedium"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/chapters_read" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_progress_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/marginClose"
                    tools:text="12054 / 54987" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_progress_percentage_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/marginClose"
                    tools:text="(10%)" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/stats_read_duration_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/marginNormal"
                android:layout_weight="1"
                android:orientation="vertical">

                <com.google.android.material.textview.MaterialTextView
                    style="?textAppearanceLabelMedium"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/read_duration" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/stats_read_duration_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/marginClose"
                    tools:text="0" />

            </LinearLayout>
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>