<?xml version="1.0" encoding="utf-8"?><!--
    Copyright 2018 Thomas Schneider

    This file is a part of Fedilab

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation; either version 3 of the
    License, or (at your option) any later version.

    Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    Public License for more details.

    You should have received a copy of the GNU General Public License along with Fedilab; if not,
    see <http://www.gnu.org/licenses>.
-->

<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"
    android:keepScreenOn="true"
    tools:context="app.fedilab.android.activities.PeertubeActivity">

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

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

            <FrameLayout
                android:id="@+id/main_media_frame"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:layout_gravity="center"
                android:background="#000000"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <com.google.android.exoplayer2.ui.PlayerView
                    android:id="@+id/media_video"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center" />

                <app.fedilab.android.webview.CustomWebview
                    android:id="@+id/webview_video"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:visibility="gone" />

            </FrameLayout>

            <!-- Main Loader -->
            <RelativeLayout
                android:id="@+id/loader"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:visibility="gone">

                <ProgressBar
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:indeterminate="true" />
            </RelativeLayout>
        </RelativeLayout>

        <ScrollView
            android:id="@+id/peertube_information_container"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="2">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:layout_marginLeft="20dp"
                android:layout_marginEnd="20dp"
                android:layout_marginRight="20dp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/peertube_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp" />

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

                    <TextView
                        android:id="@+id/peertube_view_count"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_visibility_peertube"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="0"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/peertube_like_count"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="20dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_thumb_up_peertube"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="0"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/peertube_dislike_count"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_thumb_down_peertube"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="0"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/peertube_bookmark"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_bookmark_peertube_border"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="" />

                    <TextView
                        android:id="@+id/peertube_playlist"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_list_peertube_activity"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text=""
                        android:visibility="gone" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        tools:ignore="UselessLeaf" />

                    <TextView
                        android:id="@+id/peertube_share"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_share_peertube"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="@string/more_action_6"
                        android:textSize="12sp" />

                    <TextView
                        android:id="@+id/peertube_download"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginStart="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginRight="10dp"
                        android:drawableTop="@drawable/ic_cloud_download_peertube"
                        android:drawablePadding="5dp"
                        android:gravity="center_horizontal"
                        android:text="@string/download"
                        android:textSize="12sp" />
                </LinearLayout>

                <TextView
                    android:id="@+id/peertube_description"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp" />

                <LinearLayout
                    android:id="@+id/write_comment_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginTop="10dp"
                    android:orientation="horizontal"
                    android:visibility="gone">

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

                        <ImageView
                            android:id="@+id/my_pp"
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:contentDescription="@string/profile_picture" />

                        <ImageView
                            android:id="@+id/send"
                            android:layout_width="30dp"
                            android:layout_height="30dp"
                            android:layout_marginTop="5dp"
                            android:contentDescription="@string/send_comment"
                            android:src="@drawable/ic_send"
                            android:visibility="gone" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="5dp"
                        android:layout_marginBottom="5dp"
                        android:layout_weight="1"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/add_comment_read"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/add_public_comment" />

                        <EditText
                            android:id="@+id/add_comment_write"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:focusable="true"
                            android:focusableInTouchMode="true"
                            android:hint="@string/add_public_comment"
                            android:inputType="textMultiLine"
                            android:maxLines="4"
                            android:overScrollMode="always"
                            android:scrollbarStyle="insideInset"
                            android:scrollbars="vertical"
                            android:visibility="gone" />
                    </LinearLayout>

                </LinearLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/peertube_comments"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <RelativeLayout
                    android:id="@+id/no_action"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone">

                    <TextView
                        android:id="@+id/no_action_text"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"
                        android:gravity="center"
                        android:padding="10dp"
                        android:text="@string/no_comments"
                        android:textSize="25sp"
                        android:textStyle="italic|bold"
                        android:typeface="serif" />
                </RelativeLayout>
            </LinearLayout>
        </ScrollView>
        <!-- View where the video will be shown when video goes fullscreen -->
        <RelativeLayout
            android:id="@+id/videoLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/black"
            android:visibility="gone" />
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
