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.

4.4 KB
Raw Blame
<?xml version="1.0" encoding="utf-8"?>
<!--
  The widget as a square of two by two, the way the small widgets of other
  phones are drawn. Two columns, each as tall as the widget, so neither can push
  the other out of it: the cover at the top of the first and the song at its
  foot; the mark at the top of the second and, at its foot, previous and next
  as bare icons one above the other, over play.
-->
<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:orientation="horizontal"
        android:paddingStart="12dp"
        android:paddingTop="12dp"
        android:paddingEnd="8dp"
        android:paddingBottom="10dp">

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

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

            <!-- A FrameLayout, not a View: a widget may not inflate a plain View. -->
            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1" />

            <TextView
                android:id="@+id/widget_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="2"
                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
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginStart="4dp"
            android:gravity="center_horizontal"
            android:orientation="vertical">

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

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1" />

            <ImageView
                android:id="@+id/widget_previous"
                android:layout_width="28dp"
                android:layout_height="24dp"
                android:contentDescription="@string/previous"
                android:padding="4dp"
                android:src="@drawable/ic_widget_previous" />

            <ImageView
                android:id="@+id/widget_next"
                android:layout_width="28dp"
                android:layout_height="24dp"
                android:layout_marginTop="2dp"
                android:contentDescription="@string/next"
                android:padding="4dp"
                android:src="@drawable/ic_widget_next" />

            <ImageView
                android:id="@+id/widget_toggle"
                android:layout_width="38dp"
                android:layout_height="38dp"
                android:layout_marginTop="4dp"
                android:background="@drawable/widget_button_primary"
                android:padding="11dp"
                android:src="@drawable/ic_pip_play"
                android:tint="#FF111114" />
        </LinearLayout>
    </LinearLayout>
</FrameLayout>