<?xml version="1.0" encoding="utf-8"?>
<com.github.libretube.views.CustomSwipeToRefresh 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:id="@+id/channel_refresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:id="@+id/channel_scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:visibility="invisible"
        tools:context=".fragments.ChannelFragment">

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

            <ImageView
                android:id="@+id/channel_banner"
                android:layout_width="match_parent"
                android:layout_height="80dp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="10dp"
                android:orientation="horizontal">

                <de.hdodenhof.circleimageview.CircleImageView
                    android:id="@+id/channel_image"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:layout_gravity="center_horizontal" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="5dp"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3.5dp">

                        <TextView
                            android:id="@+id/channel_name"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="left"
                            android:drawablePadding="3dip"
                            android:ellipsize="end"
                            android:maxLines="1"
                            android:textSize="16sp"
                            android:textStyle="bold"
                            tools:text="Channel Name" />

                    </LinearLayout>

                    <TextView
                        android:id="@+id/channel_subs"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="start"
                        android:text="@string/app_name"
                        android:textSize="12sp" />

                </LinearLayout>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/channel_subscribe"
                    style="@style/Widget.Material3.Button.ElevatedButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawableStart="@drawable/ic_bell_small"
                    android:drawableTint="?android:attr/textColorPrimary"
                    android:stateListAnimator="@null"
                    android:text="@string/subscribe"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="12sp"
                    app:cornerRadius="20dp"
                    app:elevation="20dp"
                    tools:targetApi="m" />

            </LinearLayout>

            <TextView
                android:id="@+id/channel_description"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:layout_marginEnd="10dp"
                android:layout_marginBottom="15dp"
                android:autoLink="web" />

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

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/channel_recView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="10dp"
                    android:nestedScrollingEnabled="false" />

            </RelativeLayout>
        </LinearLayout>
    </ScrollView>
</com.github.libretube.views.CustomSwipeToRefresh>
