Skip to content

Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.

3.6 KB
Raw Blame
<?xml version="1.0" encoding="utf-8"?>
<!--
  A narrow widget one row high: the song and the two controls that matter
  most. The mark is there when the row is wide enough to keep the title.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/background"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToOutline="true">

    <ImageView
        android:id="@+id/widget_glass"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:importantForAccessibility="no"
        android:scaleType="fitXY" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:paddingStart="10dp"
        android:paddingEnd="8dp">

        <ImageView
            android:id="@+id/widget_logo"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:contentDescription="@string/widget_open_app"
            android:padding="7dp"
            android:src="@drawable/ic_app_mark" />

        <LinearLayout
            android:id="@+id/widget_now"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/widget_cover"
                android:layout_width="44dp"
                android:layout_height="44dp"
                android:importantForAccessibility="no"
                android:scaleType="centerCrop" />

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

                <TextView
                    android:id="@+id/widget_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textColor="#FFFFFFFF"
                    android:textSize="14sp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/widget_artist"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textColor="#B3FFFFFF"
                    android:textSize="12sp" />
            </LinearLayout>
        </LinearLayout>

        <ImageView
            android:id="@+id/widget_toggle"
            android:layout_width="42dp"
            android:layout_height="42dp"
            android:layout_marginStart="6dp"
            android:background="@drawable/widget_button_primary"
            android:padding="12dp"
            android:src="@drawable/ic_pip_play"
            android:tint="#FF111114" />

        <ImageView
            android:id="@+id/widget_next"
            android:layout_width="38dp"
            android:layout_height="38dp"
            android:layout_marginStart="6dp"
            android:background="@drawable/widget_button"
            android:contentDescription="@string/next"
            android:padding="11dp"
            android:src="@drawable/ic_widget_next" />
    </LinearLayout>
</FrameLayout>