<?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:id="@+id/bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/shape_player_sheet_background"
    android:clickable="true"
    android:focusable="true"
    app:behavior_hideable="true"
    app:behavior_peekHeight="80dp"
    app:gestureInsetBottomIgnored="true"
    app:layout_behavior="@string/bottom_sheet_behavior">

    <ImageButton
        android:id="@+id/favorite_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="40dp"
        android:layout_marginBottom="16dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/liked_song"
        android:padding="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/space_placeholder"
        app:layout_constraintTop_toBottomOf="@+id/sheet_previous_metadata_button"
        app:layout_constraintVertical_bias="0.0"
        app:srcCompat="@drawable/ic_favorite_24dp" />

    <com.google.android.material.imageview.ShapeableImageView
        android:id="@+id/station_icon"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp"
        android:background="@drawable/shape_cover_small"
        android:contentDescription="@string/descr_player_station_image"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:shapeAppearanceOverlay="@style/RoundedCorners"
        app:srcCompat="@drawable/ic_default_station_image_72dp" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/player_station_name"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="12dp"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="marquee_forever"
        android:textStyle="bold"
        android:letterSpacing="0"
        android:singleLine="true"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toTopOf="@+id/player_station_metadata"
        app:layout_constraintEnd_toStartOf="@+id/player_play_button"
        app:layout_constraintStart_toEndOf="@+id/station_icon"
        app:layout_constraintTop_toTopOf="@+id/station_icon"
        tools:text="@string/sample_text_station_name" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/player_station_metadata"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="8dp"
        android:ellipsize="end"
        android:letterSpacing="0"
        android:singleLine="true"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.Material3.BodySmall"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toBottomOf="@+id/station_icon"
        app:layout_constraintEnd_toStartOf="@+id/player_play_button"
        app:layout_constraintStart_toEndOf="@+id/station_icon"
        app:layout_constraintTop_toBottomOf="@+id/player_station_name"
        tools:text="@string/sample_text_station_metadata" />

    <ImageButton
        android:id="@+id/player_play_button"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_marginEnd="8dp"
        android:background="@drawable/selector_play_button"
        android:contentDescription="@string/descr_player_playback_button"
        android:scaleType="center"
        app:layout_constraintBottom_toBottomOf="@+id/station_icon"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/station_icon"
        app:srcCompat="@drawable/ic_player_play_symbol_42dp" />

    <ProgressBar
        android:id="@+id/player_buffering_indicator"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="72dp"
        android:layout_height="72dp"
        android:layout_marginEnd="2dp"
        android:indeterminateTint="@color/player_button_buffering"
        android:indeterminateTintMode="src_in"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="@+id/station_icon"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/station_icon"
        tools:visibility="visible" />

    <ImageView
        android:id="@+id/sheet_streaming_link_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:contentDescription="@null"
        android:padding="8dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/station_icon"
        app:srcCompat="@drawable/ic_player_sheet_music_note_24dp" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sheet_streaming_link_headline"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/player_sheet_h2_stream_url"
        android:textAllCaps="true"
        android:textAppearance="@style/TextAppearance.Material3.LabelMedium"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toTopOf="@+id/sheet_streaming_link"
        app:layout_constraintEnd_toEndOf="@+id/sheet_streaming_link"
        app:layout_constraintStart_toStartOf="@+id/sheet_streaming_link" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sheet_streaming_link"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:singleLine="true"
        android:textAppearance="@style/TextAppearance.Material3.BodySmall"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toBottomOf="@+id/sheet_streaming_link_icon"
        app:layout_constraintEnd_toStartOf="@+id/sheet_share_link_button"
        app:layout_constraintStart_toEndOf="@+id/sheet_streaming_link_icon"
        app:layout_constraintTop_toTopOf="@+id/sheet_streaming_link_icon"
        tools:text="@string/sample_text_steam_url" />

    <ImageView
        android:id="@+id/sheet_share_link_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@null"
        android:padding="8dp"
        app:layout_constraintBottom_toBottomOf="@+id/sheet_streaming_link_icon"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/sheet_streaming_link_icon"
        app:srcCompat="@drawable/ic_share_24dp" />

    <ImageButton
        android:id="@+id/sheet_previous_metadata_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/descr_expanded_player_metadata_previous_button"
        android:padding="8dp"
        android:visibility="invisible"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/sheet_streaming_link_icon"
        app:srcCompat="@drawable/ic_chevron_left_24dp" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sheet_metadata_headline"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/player_sheet_h2_station_metadata"
        android:textAllCaps="true"
        android:textAppearance="@style/TextAppearance.Material3.LabelMedium"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toTopOf="@+id/sheet_metadata_history"
        app:layout_constraintEnd_toEndOf="@+id/sheet_metadata_history"
        app:layout_constraintStart_toStartOf="@+id/sheet_metadata_history" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sheet_metadata_history"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:marqueeRepeatLimit="marquee_forever"
        android:singleLine="true"
        android:textAppearance="@style/TextAppearance.Material3.BodySmall"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toBottomOf="@+id/sheet_previous_metadata_button"
        app:layout_constraintEnd_toStartOf="@+id/sheet_next_metadata_button"
        app:layout_constraintStart_toEndOf="@+id/sheet_previous_metadata_button"
        app:layout_constraintTop_toTopOf="@+id/sheet_previous_metadata_button"
        tools:text="@string/sample_text_station_metadata" />

    <ImageButton
        android:id="@+id/sheet_next_metadata_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/descr_expanded_player_metadata_next_button"
        android:padding="8dp"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="@+id/sheet_previous_metadata_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/sheet_previous_metadata_button"
        app:srcCompat="@drawable/ic_chevron_right_24dp" />

    <ImageButton
        android:id="@+id/copy_station_metadata_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="16dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/descr_expanded_player_metadata_copy_button"
        android:padding="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/sheet_previous_metadata_button"
        app:srcCompat="@drawable/ic_copy_content_24dp" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sheet_bitrate_view"
        android:layout_width="157dp"
        android:layout_height="33dp"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="16dp"
        android:gravity="center"
        android:lines="2"
        android:singleLine="false"
        android:textAppearance="@style/TextAppearance.Material3.LabelMedium"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@+id/sleep_timer_start_button"
        app:layout_constraintStart_toStartOf="@+id/copy_station_metadata_button"
        app:layout_constraintTop_toBottomOf="@+id/sheet_previous_metadata_button"
        tools:text="@string/sample_text_steam_bitrate" />

    <Space
        android:id="@+id/space_placeholder"
        android:layout_width="8dp"
        android:layout_height="40dp"
        app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_start_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/sleep_timer_start_button" />

    <ImageButton
        android:id="@+id/sleep_timer_start_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="16dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/descr_expanded_player_sleep_timer_start_button"
        android:padding="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/space_placeholder"
        app:layout_constraintTop_toBottomOf="@+id/sheet_previous_metadata_button"
        app:srcCompat="@drawable/ic_sleep_timer_24dp" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/sleep_timer_remaining_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="2dp"
        android:contentDescription="@string/descr_expanded_player_sleep_timer_remaining_time"
        android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
        android:textColor="@color/player_sheet_text_main"
        app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_start_button"
        app:layout_constraintEnd_toStartOf="@+id/sleep_timer_start_button"
        app:layout_constraintTop_toTopOf="@+id/sleep_timer_start_button"
        tools:text="@string/sample_text_sleep_timer_remaining_time" />

    <ImageButton
        android:id="@+id/sleep_timer_cancel_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:clickable="true"
        android:contentDescription="@string/descr_expanded_player_sleep_timer_cancel_button"
        android:focusable="true"
        android:padding="8dp"
        app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_remaining_time"
        app:layout_constraintEnd_toStartOf="@+id/sleep_timer_remaining_time"
        app:layout_constraintTop_toTopOf="@+id/sleep_timer_remaining_time"
        app:srcCompat="@drawable/ic_clear_24dp" />


    <!-- Constraintlayout View Groups -->
    <androidx.constraintlayout.widget.Group
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="visible"
        app:constraint_referenced_ids="sheet_metadata_headline,sheet_metadata_history,sheet_next_metadata_button,sheet_previous_metadata_button" />

    <androidx.constraintlayout.widget.Group
        android:id="@+id/sleep_timer_running_views"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="gone"
        app:constraint_referenced_ids="sleep_timer_remaining_time,sleep_timer_cancel_button" />

</androidx.constraintlayout.widget.ConstraintLayout>