<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:orientation="vertical"
    android:fitsSystemWindows="false"
    android:background="@drawable/bottom_menu_border"
    android:id="@+id/root"
    android:clickable="true">

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

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp"
            android:layout_marginTop="10dp">

            <LinearLayout
                android:id="@+id/layout_channel_button"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintRight_toLeftOf="@id/button_subscribe">

                <com.futo.platformplayer.views.others.CreatorThumbnail
                    android:id="@+id/creator_thumbnail"
                    android:layout_width="27dp"
                    android:layout_height="27dp"
                    android:contentDescription="@string/cd_creator_thumbnail" />
                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:layout_marginStart="6dp"
                    android:orientation="vertical">
                    <TextView
                        android:id="@+id/text_channel_name"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textColor="@color/white"
                        android:layout_gravity="center"
                        android:layout_marginTop="-4dp"
                        android:ellipsize="end"
                        android:maxLines="1"
                        tools:text="Channel Name" />
                    <TextView
                        android:id="@+id/text_channel_meta"
                        android:layout_width="match_parent"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:textColor="#ACACAC"
                        android:textSize="9sp"
                        android:layout_gravity="center"
                        android:ellipsize="end"
                        android:maxLines="1"
                        tools:text="" />

                </LinearLayout>
            </LinearLayout>

            <com.futo.platformplayer.views.subscriptions.SubscribeButton
                android:id="@+id/button_subscribe"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintRight_toRightOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <TextView
            android:id="@+id/text_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:text="24 Things I Wish I Had Done Sooner (or my biggest regrets)"
            android:fontFamily="@font/inter_medium"
            android:textColor="@color/white"
            android:textSize="17sp"
            android:textIsSelectable="true"
            android:layout_marginTop="8dp"
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp"
            android:layout_marginTop="4dp">

            <TextView
                android:id="@+id/text_meta"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                tools:text="51K views • 3 years ago"
                android:fontFamily="@font/inter_regular"
                android:textColor="@color/gray_ac"
                android:textSize="10dp"
                android:layout_gravity="center_vertical"/>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="end|center_vertical"
                android:gravity="center_vertical">

                <LinearLayout
                    android:id="@+id/layout_rating"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    android:gravity="center_vertical">

                    <ImageView
                        android:id="@+id/image_like_icon"
                        android:layout_width="18dp"
                        android:layout_height="18dp"
                        android:contentDescription="@string/cd_image_like_icon"
                        app:srcCompat="@drawable/ic_thumb_up" />

                    <TextView
                        android:id="@+id/text_likes"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:layout_marginStart="8dp"
                        tools:text="500K"
                        android:textColor="@color/white"
                        android:textSize="10dp" />

                    <ImageView
                        android:id="@+id/image_dislike_icon"
                        android:layout_width="18dp"
                        android:layout_height="18dp"
                        android:contentDescription="@string/cd_image_dislike_icon"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="2dp"
                        app:srcCompat="@drawable/ic_thumb_down" />

                    <TextView
                        android:id="@+id/text_dislikes"
                        android:layout_width="wrap_content"
                        android:layout_height="18dp"
                        android:gravity="center_vertical"
                        android:layout_marginStart="8dp"
                        tools:text="500K"
                        android:textColor="@color/white"
                        android:textSize="10dp" />
                </LinearLayout>

                <com.futo.platformplayer.views.platform.PlatformIndicator
                    android:id="@+id/platform_indicator"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:scaleType="centerInside"
                    tools:src="@drawable/ic_peertube"
                    android:layout_marginStart="8dp"
                    app:layout_constraintTop_toTopOf="@id/image_author_thumbnail"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintBottom_toBottomOf="@id/image_author_thumbnail" />
            </LinearLayout>
        </FrameLayout>

        <TextView
            android:id="@+id/text_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="12sp"
            android:fontFamily="@font/inter_regular"
            android:textColor="@color/white"
            tools:text="Of all the things in life we don’t control, the past is the clearest. It already happened. It’s done. It’s set in stone.\n\nPerhaps we could have controlled and changed it, but the fact is, we didn’t. And now it is what it is, forever a was."
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp"
            android:layout_marginTop="8dp"
            android:textIsSelectable="true" />

        <ImageView
            android:id="@+id/image_active"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            tools:srcCompat="@drawable/placeholder_video_thumbnail" />

        <com.google.android.flexbox.FlexboxLayout
            android:id="@+id/layout_thumbnails"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="7dp"
            android:layout_marginEnd="7dp"
            android:layout_marginBottom="7dp"
            app:justifyContent="center"
            app:flexWrap="wrap">
        </com.google.android.flexbox.FlexboxLayout>

        <LinearLayout
            android:id="@+id/layout_monetization"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="14dp"
            android:layout_marginEnd="14dp"
            android:layout_marginTop="14dp">

            <LinearLayout
                android:id="@+id/button_support"
                android:layout_width="0dp"
                android:layout_height="30dp"
                android:layout_weight="1"
                android:gravity="center"
                android:background="@drawable/background_support">

                <ImageView
                    android:layout_width="18dp"
                    android:layout_height="18dp"
                    android:src="@drawable/ic_paid" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="@color/white"
                    android:fontFamily="@font/inter_light"
                    android:text="@string/support"
                    android:textSize="14dp"
                    android:includeFontPadding="false"
                    android:layout_marginStart="6dp" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/button_store"
                android:layout_width="0dp"
                android:layout_height="30dp"
                android:layout_weight="1"
                android:gravity="center"
                android:layout_marginStart="8dp"
                android:background="@drawable/background_store">

                <ImageView
                    android:layout_width="18dp"
                    android:layout_height="18dp"
                    android:src="@drawable/ic_store" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="@color/white"
                    android:fontFamily="@font/inter_light"
                    android:text="@string/store"
                    android:textSize="14dp"
                    android:includeFontPadding="false"
                    android:layout_marginStart="6dp" />

            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:layout_marginTop="10dp">

            <com.futo.platformplayer.views.pills.PillRatingLikesDislikes
                android:id="@+id/rating"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="15dp" />

            <Space android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1" />

            <ImageButton
                android:id="@+id/button_share"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:contentDescription="@string/cd_button_share"
                android:background="@drawable/background_button_round"
                android:gravity="center"
                android:layout_marginStart="5dp"
                android:orientation="horizontal"
                app:srcCompat="@drawable/ic_share"
                app:tint="@color/white"
                android:padding="8dp"
                android:layout_marginEnd="15dp"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                android:scaleType="fitCenter" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layout_change_bottom_section"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@drawable/background_videodetail_description"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp">

            <Button
                android:id="@+id/button_polycentric"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="?android:attr/selectableItemBackground"
                android:text="Polycentric"
                android:textColor="#fff"
                android:textSize="10dp"
                android:lines="1"
                android:ellipsize="marquee"
                android:padding="10dp" />

            <Button
                android:id="@+id/button_platform"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="?android:attr/selectableItemBackground"
                android:text="Platform"
                android:textColor="#fff"
                android:textSize="10dp"
                android:lines="1"
                android:ellipsize="marquee"
                android:padding="10dp" />
        </LinearLayout>

        <com.futo.platformplayer.views.comments.AddCommentView
            android:id="@+id/add_comment_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:layout_marginBottom="12dp"
            android:layout_marginStart="28dp"
            android:layout_marginEnd="28dp" />
    </LinearLayout>

    <com.futo.platformplayer.views.segments.CommentsList
        android:id="@+id/comments_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <FrameLayout
        android:id="@+id/layout_loading_overlay"
        android:visibility="gone"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#77000000"
        android:elevation="4dp">
        <ImageView
            android:id="@+id/image_loader"
            android:layout_width="80dp"
            android:layout_height="80dp"
            app:srcCompat="@drawable/ic_loader_animated"
            android:layout_gravity="top|center_horizontal"
            android:alpha="0.7"
            android:layout_marginTop="80dp"
            android:contentDescription="@string/loading" />
    </FrameLayout>

    <com.futo.platformplayer.views.overlays.RepliesOverlay
        android:id="@+id/replies_overlay"
        android:visibility="gone"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</FrameLayout>