<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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"
    app:cardBackgroundColor="?android:colorBackground"
    app:cardCornerRadius="0dp"
    app:cardElevation="0dp"
    tools:context=".media.MediaInfoFragment"
    tools:ignore="SpeakableTextPresentCheck">

    <androidx.core.widget.NestedScrollView

        android:id="@+id/mediaInfoScroll"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center">

            <ProgressBar
                android:id="@+id/mediaInfoProgressBar"
                style="?android:attr/progressBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="32dp"
                android:indeterminate="true"
                android:visibility="gone"
                tools:visibility="gone" />

            <LinearLayout
                android:id="@+id/mediaInfoContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:visibility="gone"
                tools:visibility="visible">

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical"
                    android:paddingHorizontal="32dp"
                    android:paddingTop="16dp"
                    android:paddingBottom="16dp">

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/mean_score"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoMeanScore"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd"
                            android:textColor="?attr/colorPrimary" />

                        <TextView
                            android:id="@+id/textView3"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/poppins_bold"
                            android:text="@string/score_suffix" />

                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/status_title"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoStatus"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/mediaInfoTotalTitle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/total_eps"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoTotal"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:id="@+id/mediaInfoDurationContainer"
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal"
                        android:visibility="gone">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/ep_duration"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoDuration"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/format"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoFormat"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/source"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoSource"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:id="@+id/mediaInfoStudioContainer"
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal"
                        android:visibility="gone">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/main_studio"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoStudio"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd"
                            android:textColor="?attr/colorPrimary" />
                    </TableRow>

                    <TableRow
                        android:id="@+id/mediaInfoAuthorContainer"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal"
                        android:visibility="gone">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/author"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoAuthor"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd"
                            android:textColor="?attr/colorPrimary" />
                    </TableRow>

                    <TableRow
                        android:id="@+id/mediaInfoSeasonContainer"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal"
                        android:visibility="gone">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/season"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoSeason"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/start_date"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoStart"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/end_date"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoEnd"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/popularity"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoPopularity"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="24dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/favourites"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoFavorites"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:fontFamily="@font/poppins_bold"
                            android:textAlignment="textEnd" />
                    </TableRow>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="16dp" />

                    <LinearLayout
                        android:id="@+id/mediaInfoNameRomajiContainer"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:visibility="gone">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/name_romaji"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoNameRomaji"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:breakStrategy="balanced"
                            android:fontFamily="@font/poppins_bold"
                            tools:targetApi="m" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/mediaInfoNameContainer"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:alpha="0.58"
                            android:text="@string/name"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/mediaInfoName"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:breakStrategy="balanced"
                            android:fontFamily="@font/poppins_bold"
                            tools:targetApi="m" />
                    </LinearLayout>
                </TableLayout>

                <TextView
                    android:id="@+id/mediaInfoDescriptionText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="32dp"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/description"
                    android:textSize="16sp" />

                <TextView
                    android:id="@+id/mediaInfoDescription"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="16dp"
                    android:ellipsize="end"
                    android:maxLines="5"
                    android:padding="16dp"
                    android:text="@string/description" />

            </LinearLayout>
        </FrameLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.cardview.widget.CardView>
