<?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:id="@+id/track"
    app:cardElevation="0dp"
    style="@style/Widget.Tachiyomi.CardView.Tracker"
    android:padding="0dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/track_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="?background">

        <FrameLayout
            android:id="@+id/logo_container"
            android:layout_width="48dp"
            android:layout_height="0dp"
            android:clickable="true"
            android:focusable="true"
            android:foreground="?selectableItemBackgroundBorderless"
            android:gravity="center"
            android:orientation="vertical"
            android:padding="4dp"
            app:layout_constraintBottom_toBottomOf="@id/status_container"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:background="#2E51A2">

            <ImageView
                android:id="@+id/track_logo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:contentDescription="@string/tracking"
                tools:src="@drawable/ic_tracker_mal" />

            <com.google.android.material.progressindicator.CircularProgressIndicator
                android:id="@+id/progress"
                android:indeterminate="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:progressTint="@color/md_white_1000"
                android:indeterminateTint="@color/md_white_1000"
                android:padding="4dp"
                android:visibility="gone" />

        </FrameLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/status_container"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="@drawable/card_item_selector"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/logo_container"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                android:id="@+id/track_title"
                style="?textAppearanceTitleMedium"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="@drawable/card_item_selector"
                android:ellipsize="end"
                android:maxLines="1"
                android:paddingStart="16dp"
                android:paddingTop="16dp"
                android:paddingEnd="44dp"
                android:paddingBottom="16dp"
                android:text="@string/title"
                android:textSize="14sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="@id/status_container"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:text="Tracking name that is really long so i can see the padding in work like so here" />

            <ImageView
                android:id="@+id/track_remove"
                style="@style/Theme.Widget.CustomImageButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="4dp"
                android:padding="6dp"
                android:contentDescription="@string/open_in_webview"
                android:src="@drawable/ic_close_circle_24dp"
                app:tint="@color/text_color_secondary"
                android:tooltipText="@string/remove_tracking"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <View
            android:id="@+id/divider"
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:alpha="0.25"
            android:background="@color/strong_divider"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/logo_container"
            app:layout_constraintTop_toBottomOf="@+id/status_container" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/sub_tracking_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/divider">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/top_tracking_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintBottom_toTopOf="@id/bottom_divider"
                app:layout_constraintTop_toTopOf="parent">
                <TextView
                    android:id="@+id/track_status"
                    style="?textAppearanceBodySecondary"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/card_item_selector"
                    android:gravity="center"
                    android:maxLines="2"
                    android:paddingStart="6dp"
                    android:paddingTop="16dp"
                    android:paddingEnd="6dp"
                    android:paddingBottom="16dp"
                    app:layout_constraintHeight_min="wrap"
                    app:layout_constraintEnd_toStartOf="@id/track_chapters"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="Currently Reading" />

                <TextView
                    android:id="@+id/track_chapters"
                    style="?textAppearanceBodySecondary"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/card_item_selector"
                    android:gravity="center"
                    android:maxLines="2"
                    android:paddingTop="16dp"
                    android:paddingBottom="16dp"
                    app:layout_constraintHeight_min="wrap"
                    app:layout_constraintEnd_toStartOf="@id/score_container"
                    app:layout_constraintStart_toEndOf="@id/track_status"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    tools:text="Chapter 12 of 24" />

                <FrameLayout
                    android:id="@+id/score_container"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:paddingTop="16dp"
                    android:paddingBottom="16dp"
                    android:background="@drawable/card_item_selector"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHeight_min="wrap"
                    app:layout_constraintStart_toEndOf="@id/track_chapters"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintTop_toTopOf="parent" >

                    <TextView
                        android:id="@+id/track_score"
                        style="?textAppearanceBodySecondary"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        app:drawableTint="?attr/colorOnBackground"
                        tools:text="10"
                        app:drawableEndCompat="@drawable/ic_star_12dp" />
                </FrameLayout>

                <View
                    android:layout_width="1dp"
                    android:layout_height="0dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:alpha="0.25"
                    android:background="@color/strong_divider"
                    app:layout_constraintEnd_toStartOf="@id/track_chapters"
                    app:layout_constraintStart_toEndOf="@id/track_status"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <View
                    android:id="@+id/vert_divider_2"
                    android:layout_width="1dp"
                    android:layout_height="0dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:alpha="0.25"
                    android:background="@color/strong_divider"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/score_container"
                    app:layout_constraintStart_toEndOf="@+id/track_chapters"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <View
                android:id="@+id/bottom_divider"
                android:layout_width="0dp"
                android:layout_height="1dp"
                android:alpha="0.25"
                android:background="@color/strong_divider"
                app:layout_constraintTop_toBottomOf="@id/top_tracking_layout"
                app:layout_constraintBottom_toTopOf="@id/track_start_date"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent" />

            <TextView
                android:id="@+id/track_start_date"
                style="?textAppearanceBodySecondary"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="@drawable/card_item_selector"
                android:ellipsize="end"
                android:gravity="center"
                android:maxLines="1"
                android:padding="16dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/vert_divider_3"
                app:layout_constraintTop_toBottomOf="@+id/bottom_divider"
                tools:text="4/16/2020" />

            <View
                android:id="@+id/vert_divider_3"
                android:layout_width="1dp"
                android:layout_height="0dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="8dp"
                android:alpha="0.25"
                android:background="@color/strong_divider"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toEndOf="@+id/track_start_date"
                app:layout_constraintEnd_toStartOf="@+id/track_finish_date"
                app:layout_constraintTop_toTopOf="@+id/bottom_divider" />

            <TextView
                android:id="@+id/track_finish_date"
                style="?textAppearanceBodySecondary"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="@drawable/card_item_selector"
                android:ellipsize="end"
                android:gravity="center"
                android:maxLines="1"
                android:padding="16dp"
                app:layout_constraintStart_toEndOf="@+id/vert_divider_3"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bottom_divider"
                tools:text="4/16/2020" />

            <androidx.constraintlayout.widget.Group
                android:id="@+id/date_group"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:constraint_referenced_ids="vert_divider_3,bottom_divider,track_start_date,track_finish_date" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/add_tracking"
            style="@style/Theme.Widget.Button.TextButton"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:letterSpacing="0.0"
            android:paddingStart="16dp"
            android:paddingEnd="0dp"
            android:text="@string/add_tracking"
            android:textAlignment="textStart"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/logo_container"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/track_group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:constraint_referenced_ids="sub_tracking_layout,status_container,divider" />

    </androidx.constraintlayout.widget.ConstraintLayout>

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