<?xml version="1.0" encoding="utf-8"?>

<!--
SPDX-FileCopyrightText: 2023 Albert Vaca Cintora <albertvaka@gmail.com>

SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mpris_control_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical">

    <TextView
        android:id="@+id/no_players"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="@string/no_players_connected"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <Spinner
        android:id="@+id/player_spinner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center" />

    <TextView
        android:id="@+id/now_playing_textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:ellipsize="marquee"
        android:gravity="center"
        android:marqueeRepeatLimit="marquee_forever"
        android:padding="8dip"
        android:scrollHorizontally="true"
        android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="75dp"
        android:layout_gravity="center"
        android:orientation="horizontal">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/loop_button"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="false"
            android:baselineAlignBottom="true"
            android:clickable="false"
            android:contentDescription="@string/mpris_loop"
            app:icon="@drawable/ic_loop_none_black"
            style="@style/KdeConnectButton.IconButton"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_percent="0.20" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/play_button"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="false"
            android:baselineAlignBottom="true"
            android:clickable="false"
            android:contentDescription="@string/mpris_play"
            app:icon="@drawable/ic_play_black"
            style="@style/KdeConnectButton.IconButton"
            app:layout_constraintEnd_toStartOf="@id/shuffle_button"
            app:layout_constraintStart_toEndOf="@id/loop_button"
            app:layout_constraintTop_toTopOf="parent" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/shuffle_button"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="false"
            android:baselineAlignBottom="true"
            android:clickable="false"
            android:contentDescription="@string/mpris_shuffle"
            app:icon="@drawable/ic_shuffle_off_black"
            style="@style/KdeConnectButton.IconButton"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintWidth_percent="0.20" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dip"
        android:layout_gravity="center"
        android:orientation="horizontal">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/prev_button"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_weight="0.25"
            android:contentDescription="@string/mpris_previous"
            app:icon="@drawable/ic_previous_black"
            style="@style/KdeConnectButton.IconButton.Secondary" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/rew_button"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_weight="0.25"
            android:contentDescription="@string/mpris_rew"
            app:icon="@drawable/ic_rewind_black"
            style="@style/KdeConnectButton.IconButton.Secondary" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/stop_button"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_weight="0.25"
            android:contentDescription="@string/mpris_stop"
            app:icon="@drawable/ic_stop"
            style="@style/KdeConnectButton.IconButton.Secondary" />


        <com.google.android.material.button.MaterialButton
            android:id="@+id/ff_button"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_weight="0.25"
            android:contentDescription="@string/mpris_ff"
            app:icon="@drawable/ic_fast_forward_black"
            style="@style/KdeConnectButton.IconButton.Secondary" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/next_button"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_weight="0.25"
            android:contentDescription="@string/mpris_next"
            app:icon="@drawable/ic_next_black"
            style="@style/KdeConnectButton.IconButton.Secondary" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/progress_slider"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/progress_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:padding="8dip"
            android:singleLine="true"
            android:text="00:00"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <SeekBar
            android:id="@+id/positionSeek"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1" />

        <TextView
            android:id="@+id/time_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:padding="8dip"
            android:singleLine="true"
            android:text="00:00"
            android:textAppearance="?android:attr/textAppearanceMedium" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/volume_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="8dip"
        android:orientation="horizontal">

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/imageView"
            android:layout_width="30dip"
            android:layout_height="30dip"
            android:layout_marginEnd="10dip"
            android:layout_weight="0"
            android:contentDescription="@string/mpris_volume"
            android:maxWidth="30dip"
            android:src="@drawable/ic_volume_black"/>


        <SeekBar
            android:id="@+id/volume_seek"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:max="100" />

    </LinearLayout>
</LinearLayout>
