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

    <RelativeLayout
        android:layout_height="wrap_content"
         android:layout_width="match_parent">

        <!-- Video Title Block -->
        <RelativeLayout
            android:background="?android:selectableItemBackground"
            android:id="@+id/video_title_block"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="6dp"
            android:paddingTop="6dp">

            <RelativeLayout
                android:id="@+id/video_open_description"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="6dp"
                android:layout_marginEnd="6dp">

                <TextView
                    android:id="@+id/video_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_centerVertical="true"
                    android:layout_marginStart="0dp"
                    android:layout_marginTop="6dp"
                    android:layout_marginEnd="24dp"
                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Title" />

                <ImageButton
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:layout_alignParentEnd="true"
                    android:layout_centerVertical="true"
                    android:background="@android:color/transparent"
                    android:clickable="false"
                    android:contentDescription="@string/video_meta_show_description"
                    android:src="@drawable/ic_chevron_down"
                    app:tint="?attr/colorPrimary" />
            </RelativeLayout>

            <TextView
                android:id="@+id/videoMeta"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/video_open_description"
                android:layout_alignParentEnd="true"
                android:layout_marginStart="6dp"
                android:layout_marginTop="0dp"
                android:layout_marginEnd="6dp"
                android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />

        </RelativeLayout>

        <!-- video actions -->
        <HorizontalScrollView
            android:id="@+id/video_actions_block"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/video_title_block"
            android:paddingBottom="6dp"
            android:scrollbars="none">

            <LinearLayout
                android:id="@+id/video_actions"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:layout_marginEnd="18dp"
                android:paddingEnd="18dp"
                android:paddingStart="18dp"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_thumbs_up_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_thumbs_up"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_thumbs_up"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/video_thumbs_up_total"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>

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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_thumbs_down_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_thumbs_down"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_thumbs_down"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/video_thumbs_down_total"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>

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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_share_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_share"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_share_2"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/video_share_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/video_meta_button_share"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>

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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_download_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_download"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_download"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/video_download_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/video_meta_button_download"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>


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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_add_to_playlist_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_add_to_playlist"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_playlist_add"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/video_add_to_playlist_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/video_add_to_playlist"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>


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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_block_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_block"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_slash"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/vvideo_block_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/video_block"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>


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

                <LinearLayout
                    android:layout_width="70dp"
                    android:id="@+id/video_flag_wrapper"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ImageButton
                        android:id="@+id/video_flag"
                        android:layout_width="42dp"
                        android:layout_height="42dp"
                        android:layout_gravity="center"
                        android:background="?android:selectableItemBackground"
                        android:gravity="center"
                        android:clickable="false"
                        android:src="@drawable/ic_flag"
                        app:tint="?attr/colorPrimary" />

                    <TextView
                        android:id="@+id/vvideo_flag_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/video_flag"
                        android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
                        android:textSize="12sp" />

                </LinearLayout>

            </LinearLayout>
        </HorizontalScrollView>

        <TextView
            android:layout_below="@+id/video_actions_block"
            android:id="@+id/video_action_block_line"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:background="?android:colorEdgeEffect"
            android:height="1dp"
            android:gravity="center_horizontal"/>

        <RelativeLayout
            android:id="@+id/video_account_block"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/video_action_block_line"
            android:paddingStart="12dp"
            android:paddingTop="6dp"
            android:paddingEnd="6dp">

            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/avatar"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:contentDescription="@string/video_row_account_avatar"
                android:paddingStart="6dp"
                android:paddingEnd="6dp" />

            <LinearLayout
                android:id="@+id/video_creator_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginStart="6dp"
                android:layout_toEndOf="@+id/avatar"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/videoOwner"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead" />

                <TextView
                    android:id="@+id/videoBy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/videoOwnerSubscribers"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />

            </LinearLayout>

            <TextView
                android:id="@+id/videoOwnerSubscribeButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_marginTop="0dp"
                android:layout_marginEnd="0dp"
                android:gravity="end"
                android:paddingStart="12dp"
                android:paddingEnd="12dp"
                android:text=""
                android:textAppearance="@style/Base.TextAppearance.AppCompat.Button" />


            <!--        <TextView-->
            <!--            android:id="@+id/moreButton"-->
            <!--            android:layout_width="45dp"-->
            <!--            android:layout_height="45dp"-->
            <!--            android:layout_marginStart="-16dp"-->
            <!--            android:layout_marginTop="16dp"-->
            <!--            android:layout_marginEnd="0dp"-->
            <!--            android:layout_toEndOf="@+id/sl_row_name"-->
            <!--            android:background="@null"-->
            <!--            android:contentDescription="@string/descr_overflow_button"-->
            <!--            android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />-->

        </RelativeLayout>

        <TextView
            android:layout_below="@+id/video_account_block"
            android:id="@+id/video_account_block_line"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:background="?android:colorEdgeEffect"
            android:height="1dp"
            android:gravity="center_horizontal"/>
    </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>