<?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:id="@+id/root_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/black"
    tools:context=".ui.activity.PlayActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/content_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/im_back"
            android:layout_width="42dp"
            android:layout_height="42dp"
            android:layout_marginStart="16dp"
            android:layout_marginTop="25dp"
            android:padding="9dp"
            android:src="@drawable/arrow_bottom"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/im_covert"
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:layout_marginStart="40dp"
            android:layout_marginTop="30dp"
            android:layout_marginEnd="40dp"
            android:scaleType="fitCenter"
            android:src="@drawable/placeholder"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/im_back" />

        <LinearLayout
            android:id="@+id/linear_retry"
            android:layout_width="210dp"
            android:layout_height="120dp"
            android:gravity="center"
            android:orientation="vertical"
            android:visibility="gone"
            android:background="@drawable/bg_retry"
            app:layout_constraintBottom_toBottomOf="@id/im_covert"
            app:layout_constraintLeft_toLeftOf="@id/im_covert"
            app:layout_constraintRight_toRightOf="@id/im_covert"
            app:layout_constraintTop_toTopOf="@id/im_covert">


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/An_error_occurred"
                android:textColor="@color/white"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/tv_retry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="15dp"
                android:paddingStart="15dp"
                android:paddingEnd="15dp"
                android:paddingTop="8dp"
                android:paddingBottom="8dp"
                android:text="@string/retry"
                android:background="@drawable/bg_retry_btn"
                android:textColor="@color/white"
                android:textSize="17sp" />

        </LinearLayout>


        <androidx.media3.ui.PlayerView
            android:id="@+id/player_view"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/im_back"
            app:show_buffering="when_playing"
            app:show_shuffle_button="true" />


        <TextView
            android:id="@+id/tv_song_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="25dp"
            android:layout_marginEnd="40dp"
            android:text=""
            android:textColor="@color/text_color_1"
            android:textSize="19sp"
            app:layout_constraintLeft_toLeftOf="@id/im_covert"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/im_covert" />

        <TextView
            android:id="@+id/tv_singer_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="7dp"
            android:text=""
            android:textColor="@color/white_60_color"
            android:textSize="13sp"
            app:layout_constraintLeft_toLeftOf="@id/tv_song_name"
            app:layout_constraintTop_toBottomOf="@id/tv_song_name" />


        <SeekBar
            android:id="@+id/play_progress"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="35dp"
            android:layout_marginTop="25dp"
            android:layout_marginEnd="35dp"
            android:maxHeight="3dp"
            android:paddingStart="5dp"
            android:paddingLeft="0dp"
            android:paddingEnd="5dp"
            android:paddingRight="0dp"
            android:progress="30"
            android:progressDrawable="@drawable/seekbar_progress_drawable"
            android:thumb="@drawable/seekbar_thumb"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_singer_name" />


        <ProgressBar
            android:id="@+id/progressBar_buffer"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="0dp"
            android:layout_height="3dp"
            android:paddingStart="5dp"
            android:paddingEnd="5dp"
            android:progress="100"
            android:progressDrawable="@drawable/horizontal_progressbar"
            app:layout_constraintBottom_toBottomOf="@id/play_progress"
            app:layout_constraintLeft_toLeftOf="@id/play_progress"
            app:layout_constraintRight_toRightOf="@id/play_progress"
            app:layout_constraintTop_toTopOf="@id/play_progress" />

        <TextView
            android:id="@+id/tv_current"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:paddingStart="5dp"
            android:text="0:00"
            android:textColor="@color/white_60_color"
            app:layout_constraintStart_toStartOf="@id/play_progress"
            app:layout_constraintTop_toBottomOf="@id/play_progress" />

        <TextView
            android:id="@+id/tv_duration"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:paddingEnd="5dp"
            android:text="0:00"
            android:textColor="@color/white_60_color"
            app:layout_constraintEnd_toEndOf="@id/play_progress"
            app:layout_constraintTop_toBottomOf="@id/play_progress" />

        <ImageView
            android:id="@+id/btn_play"
            android:layout_width="66dp"
            android:layout_height="66dp"
            android:layout_marginTop="15dp"
            android:src="@drawable/selector_icon_play"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_duration" />

        <ImageView
            android:id="@+id/btn_previous"
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:layout_marginEnd="24dp"
            android:padding="12dp"
            android:src="@mipmap/icon_previous_true"
            app:layout_constraintBottom_toBottomOf="@id/btn_play"
            app:layout_constraintEnd_toStartOf="@id/btn_play"
            app:layout_constraintTop_toTopOf="@id/btn_play" />


        <ImageView
            android:id="@+id/btn_next"
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:layout_marginStart="24dp"
            android:src="@mipmap/icon_next_true"
            android:padding="12dp"
            app:layout_constraintBottom_toBottomOf="@id/btn_play"
            app:layout_constraintStart_toEndOf="@id/btn_play"
            app:layout_constraintTop_toTopOf="@id/btn_play" />

        <ImageView
            android:id="@+id/btn_music_list"
            android:layout_width="44dp"
            android:layout_height="44dp"
            android:src="@mipmap/icon_list"
            android:padding="10dp"
            app:layout_constraintBottom_toBottomOf="@id/btn_play"
            app:layout_constraintLeft_toRightOf="@id/btn_next"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@id/btn_play" />


        <ImageView
            android:id="@+id/btn_loop"
            android:layout_width="44dp"
            android:layout_height="44dp"
            android:src="@drawable/icon_looper_no"
            android:padding="10dp"
            app:layout_constraintBottom_toBottomOf="@id/btn_play"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toLeftOf="@id/btn_previous"
            app:layout_constraintTop_toTopOf="@id/btn_play" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <include
        android:id="@+id/layout_playList"
        layout="@layout/dialog_play_list" />


    <ProgressBar
        android:id="@+id/progressBarLoading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminateTint="@color/white"
        android:visibility="gone" />
</FrameLayout>