<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:minHeight="120dp"
    android:paddingStart="8dp"
    android:paddingEnd="8dp"
    android:paddingTop="8dp"
    android:paddingBottom="12dp"
    android:orientation="horizontal"
    android:baselineAligned="false"
    android:background="@drawable/widget_bg">

    <FrameLayout
        android:id="@+id/album_art_container"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="center_vertical">

        <ImageView
            android:id="@+id/album_art"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:contentDescription="@string/widget_content_desc_album_art" />
    </FrameLayout>

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_marginStart="12dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:weightSum="1">

        <LinearLayout
            android:id="@+id/text_container"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="vertical">

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:marqueeRepeatLimit="marquee_forever"
                android:scrollHorizontally="true"
                android:textStyle="bold"
                android:textSize="16sp"
                android:textColor="@color/widget_title"
                android:includeFontPadding="false"
                android:freezesText="true" />

            <LinearLayout
                android:id="@+id/subtitle_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:baselineAligned="false">

            <TextView
                    android:id="@+id/subtitle"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:layout_weight="1"
                    android:singleLine="true"
                    android:ellipsize="marquee"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:scrollHorizontally="true"
                    android:textSize="13sp"
                    android:textColor="@color/widget_subtitle"
                    android:includeFontPadding="false"
                    android:freezesText="true" />

                <TextView
                    android:id="@+id/album"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:singleLine="true"
                    android:ellipsize="marquee"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:scrollHorizontally="true"
                    android:gravity="end"
                    android:textAlignment="viewEnd"
                    android:textSize="12sp"
                    android:textColor="@color/widget_subtitle"
                    android:includeFontPadding="false"
                    android:freezesText="true"
                    android:visibility="gone" />
            </LinearLayout>
        </LinearLayout>

        <ProgressBar
            android:id="@+id/progress"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="3dp"
            android:layout_marginTop="4dp"
            android:indeterminate="false"
            android:max="1000"
            android:progress="0"
            android:progressBackgroundTint="@color/widget_subtitle"
            android:progressTint="@color/widget_icon_tint" />

        <LinearLayout
            android:id="@+id/timing"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/time_elapsed"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/widget_time_elapsed_placeholder"
                android:textColor="@color/widget_subtitle"
                android:textSize="10sp" />

            <TextView
                android:id="@+id/time_total"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="end"
                android:text="@string/widget_time_duration_placeholder"
                android:textColor="@color/widget_subtitle"
                android:textSize="10sp" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/controls_secondary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:gravity="center"
            android:orientation="horizontal">

            <ImageButton
                android:id="@+id/btn_shuffle"
                android:layout_width="0dp"
                android:layout_height="32dp"
                android:layout_marginEnd="1dp"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:contentDescription="@string/widget_content_desc_shuffle"
                android:src="@drawable/ic_shuffle"
                android:tint="@color/widget_icon_tint" />

            <LinearLayout
                android:id="@+id/controls"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center"
                android:orientation="horizontal">

                <ImageButton
                    android:id="@+id/btn_prev"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_marginStart="1dp"
                    android:layout_marginEnd="1dp"
                    android:layout_weight="1"
                    android:background="@android:color/transparent"
                    android:contentDescription="@string/widget_content_desc_prev"
                    android:src="@drawable/ic_skip_previous"
                    android:tint="@color/widget_icon_tint" />

                <ImageButton
                    android:id="@+id/btn_play_pause"
                    android:layout_width="0dp"
                    android:layout_height="34dp"
                    android:layout_marginStart="1dp"
                    android:layout_marginEnd="1dp"
                    android:layout_weight="1"
                    android:background="@android:color/transparent"
                    android:contentDescription="@string/widget_content_desc_play_pause"
                    android:src="@drawable/ic_play"
                    android:tint="@color/widget_icon_tint" />

                <ImageButton
                    android:id="@+id/btn_next"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_marginStart="1dp"
                    android:layout_marginEnd="1dp"
                    android:layout_weight="1"
                    android:background="@android:color/transparent"
                    android:contentDescription="@string/widget_content_desc_next"
                    android:src="@drawable/ic_skip_next"
                    android:tint="@color/widget_icon_tint" />
            </LinearLayout>

            <ImageButton
                android:id="@+id/btn_repeat"
                android:layout_width="0dp"
                android:layout_height="32dp"
                android:layout_marginStart="1dp"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:contentDescription="@string/widget_content_desc_repeat"
                android:src="@drawable/ic_repeat"
                android:tint="@color/widget_icon_tint" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
