<?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="match_parent"
    tools:context=".ReproductorActivity">

    <RelativeLayout
        android:id="@+id/fullScreen"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <RelativeLayout
        android:id="@+id/fullScreenExo"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" >
        <androidx.media3.ui.PlayerView
            android:id="@+id/fullscreenPlayer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#000"
            app:use_controller="true"
            app:controller_layout_id="@layout/custom_player_controls"
            app:player_layout_id="@layout/exo_player_view"/>
    </RelativeLayout>


    <ScrollView
        android:id="@+id/nonFullScreen"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <WebView
                android:id="@+id/videoView"
                android:layout_width="match_parent"
                android:layout_height="222dp"
                android:layout_weight="1"
                android:visibility="gone" />

            <androidx.media3.ui.PlayerView
                android:id="@+id/exoPlayer"
                android:layout_width="match_parent"
                android:layout_height="222dp"
                app:use_controller="true"
                app:controller_layout_id="@layout/custom_player_controls"
                app:player_layout_id="@layout/exo_player_view"/>

            <TextView
                android:id="@+id/tittleVideoTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingStart="5dp"
                android:textAppearance="@android:style/TextAppearance.Material.Display1"
                android:textSize="18sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/viewsTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="5dp"
                android:paddingRight="5dp"
                android:textSize="12sp" />

            <androidx.appcompat.widget.LinearLayoutCompat
                android:id="@+id/actionsLayout"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:gravity="top"
                android:orientation="horizontal"
                android:visibility="gone">

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/likeLayout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:visibility="visible">

                    <ImageView
                        android:id="@+id/imageView"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:adjustViewBounds="false"
                        android:contentDescription="@string/likeBtn"
                        android:cropToPadding="false"
                        android:scaleType="center"
                        android:visibility="visible"
                        app:srcCompat="@drawable/ic_like" />

                    <TextView
                        android:id="@+id/textViewLike"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:text="@string/likeBtn"
                        android:textAlignment="center" />
                </androidx.appcompat.widget.LinearLayoutCompat>

                <LinearLayout
                    android:id="@+id/dislikeLayout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:visibility="visible">

                    <ImageView
                        android:id="@+id/imageView2"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:adjustViewBounds="false"
                        android:contentDescription="@string/dislikeBtn"
                        android:cropToPadding="false"
                        android:visibility="visible"
                        app:srcCompat="@drawable/ic_dislike" />

                    <TextView
                        android:id="@+id/textViewDislike"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:text="@string/dislikeBtn"
                        android:textAlignment="center" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/reportLayout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:visibility="visible">

                    <ImageView
                        android:id="@+id/imageViewAlert"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:adjustViewBounds="false"
                        android:contentDescription="@string/dislikeBtn"
                        android:cropToPadding="false"
                        android:visibility="visible"
                        app:srcCompat="@drawable/ic_alert" />

                    <TextView
                        android:id="@+id/textViewAlert"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:text="@string/reportBtn"
                        android:textAlignment="center" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/shareLayout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:visibility="visible">

                    <ImageView
                        android:id="@+id/imageViewShare"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:adjustViewBounds="false"
                        android:contentDescription="@string/shareBtn"
                        android:cropToPadding="false"
                        android:visibility="visible"
                        app:srcCompat="@drawable/ic_share" />

                    <TextView
                        android:id="@+id/textViewShare"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:text="@string/shareBtn"
                        android:textAlignment="center" />
                </LinearLayout>
            </androidx.appcompat.widget.LinearLayoutCompat>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:layout_weight="1"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/userImg"
                    android:layout_width="40dp"
                    android:layout_height="match_parent"
                    android:layout_margin="0dp"
                    android:layout_weight="1"
                    android:adjustViewBounds="false"
                    android:cropToPadding="false"
                    android:padding="5dp"
                    android:scaleType="fitCenter"
                    app:srcCompat="@drawable/default_avatar" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="3"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/userTxt"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textAppearance="@android:style/TextAppearance.Material.Large"
                        android:textSize="18sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/hostTxt"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="10sp"
                        android:textStyle="italic" />

                </LinearLayout>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/subscribeBtn"
                    style="@style/Widget.MaterialComponents.Button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/subscribeBtn"
                    android:textSize="12sp"
                    android:visibility="invisible" />
            </LinearLayout>

            <TextView
                android:id="@+id/descriptionTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLength="1000"
                android:maxLines="100"
                android:paddingLeft="5dp"
                android:text="@string/descriptionTxt"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/descriptionVideoTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:layout_marginBottom="2dp"
                android:autoLink="web"
                android:linksClickable="true"
                android:maxLength="10000"
                android:maxLines="100"
                android:paddingLeft="10dp"
                android:paddingRight="10dp" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/showMoreBtn"
                style="@style/Widget.MaterialComponents.Button.TextButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/showMore"
                android:visibility="gone" />

            <View
                android:id="@+id/divider"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="?android:attr/listDivider" />

            <androidx.legacy.widget.Space
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:layout_weight="1" />

            <TextView
                android:id="@+id/commentariesTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="5dp"
                android:text="@string/commentariesTxt"
                android:textStyle="bold" />

            <androidx.legacy.widget.Space
                android:layout_width="match_parent"
                android:layout_height="20dp" />

            <androidx.appcompat.widget.LinearLayoutCompat
                android:id="@+id/commentaryLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:visibility="gone">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <ImageView
                        android:id="@+id/userImgCom"
                        android:layout_width="10dp"
                        android:layout_height="60dp"
                        android:layout_weight="1"
                        app:srcCompat="@drawable/default_avatar" />

                    <com.google.android.material.textfield.TextInputLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="4dp"
                        android:layout_weight="3"
                        android:hint="@string/commentHolder">

                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/commentaryText"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:ems="10"
                            android:inputType="textMultiLine" />
                    </com.google.android.material.textfield.TextInputLayout>

                </LinearLayout>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/commentaryBtn"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:text="@string/commentaryText" />

            </androidx.appcompat.widget.LinearLayoutCompat>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/listCommentaries"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />


        </LinearLayout>
    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>