Files
auxio-fork/app/src/main/res/layout-v31/widget_full.xml
T
OxygenCobalt 6f8f333b72 widgets: make widget responsive
The plans for widgets have changed somewhat. Instead of 4 or so
variants, there will instead be one unified widget that chooses
different layouts depending on its size. The first one added is the
full widget, which shows more controls as long as theres enough
space.
2021-08-05 10:22:41 -06:00

102 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.Widget">
<ImageView
android:id="@+id/widget_cover"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="?attr/colorSurface"
android:scaleType="centerCrop"
tools:ignore="contentDescription"
android:src="@drawable/ic_song" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/colorSurface"
android:orientation="vertical"
android:padding="@dimen/spacing_medium">
<TextView
android:id="@+id/widget_song"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/inter"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:text="@string/placeholder_widget_song" />
<TextView
android:id="@+id/widget_artist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/inter"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/placeholder_widget_artist" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_medium"
android:orientation="horizontal">
<ImageButton
android:id="@+id/widget_loop"
style="@style/Widget.Button.Unbounded.Widget.V31"
android:layout_width="0dp"
android:layout_weight="1"
android:contentDescription="@string/description_change_loop"
android:src="@drawable/ic_loop" />
<ImageButton
android:id="@+id/widget_skip_prev"
style="@style/Widget.Button.Unbounded.Widget.V31"
android:layout_width="0dp"
android:layout_weight="1"
android:contentDescription="@string/description_skip_prev"
android:src="@drawable/ic_skip_prev" />
<ImageButton
android:id="@+id/widget_play_pause"
style="@style/Widget.Button.Unbounded.Widget.V31"
android:layout_width="0dp"
android:layout_weight="1"
android:contentDescription="@string/description_play_pause"
android:src="@drawable/ic_play" />
<ImageButton
android:id="@+id/widget_skip_next"
style="@style/Widget.Button.Unbounded.Widget.V31"
android:layout_width="0dp"
android:layout_weight="1"
android:contentDescription="@string/description_skip_next"
android:src="@drawable/ic_skip_next" />
<ImageButton
android:id="@+id/widget_shuffle"
style="@style/Widget.Button.Unbounded.Widget.V31"
android:layout_width="0dp"
android:layout_weight="1"
android:contentDescription="@string/description_shuffle_off"
android:src="@drawable/ic_shuffle" />
</LinearLayout>
</LinearLayout>
</LinearLayout>