widgets: add controls to minimal widget

Backtrack and add controls to the minimal widget, mostly for usability.
This commit is contained in:
OxygenCobalt
2021-08-03 09:05:20 -06:00
parent 8673995630
commit d3e738b973
15 changed files with 260 additions and 95 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
@@ -49,6 +49,36 @@
android:textColor="?android:attr/textColorSecondary"
tools:text="Artist Name" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/spacing_medium"
android:orientation="horizontal">
<ImageButton
android:id="@+id/widget_skip_prev"
style="@style/Widget.Button.Unbounded"
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"
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"
android:layout_weight="1"
android:contentDescription="@string/description_skip_next"
android:src="@drawable/ic_skip_next" />
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>
+2 -3
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
@@ -12,8 +11,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.3"
android:contentDescription="@string/description_placeholder_cover"
android:scaleType="centerCrop"
tools:ignore="contentDescription"
android:src="@drawable/ic_song" />
<android.widget.TextView
@@ -21,8 +20,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:fontFamily="@font/inter"
android:gravity="center"
android:padding="@dimen/spacing_medium"
android:text="@string/placeholder_playback"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
@@ -23,6 +23,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?android:attr/colorBackground"
android:elevation="@dimen/elevation_normal"
android:orientation="vertical"
android:padding="@dimen/spacing_medium">
@@ -49,6 +50,45 @@
android:textColor="?android:attr/textColorSecondary"
tools:text="Artist Name" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_medium"
android:gravity="center"
android:orientation="horizontal">
<!--
Can't use a normal unbounded ripple here since it causes a weird bug
where the ripples will have a fixed starting size. Default to the
uglier system ripple instead.
-->
<ImageButton
android:id="@+id/widget_skip_prev"
style="@style/Widget.Button.Unbounded"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/description_skip_prev"
android:src="@drawable/ic_skip_prev" />
<ImageButton
android:id="@+id/widget_play_pause"
style="@style/Widget.Button.Unbounded"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/description_play_pause"
android:src="@drawable/ic_play" />
<ImageButton
android:id="@+id/widget_skip_next"
style="@style/Widget.Button.Unbounded"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/description_skip_next"
android:src="@drawable/ic_skip_next" />
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>
@@ -6,6 +6,8 @@
useless. -->
<item name="colorPrimary">?android:attr/colorAccent</item>
<item name="colorSecondary">?android:attr/colorAccent</item>
<item name="colorControlNormal">@color/control_color</item>
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
<item name="colorSurface">@color/surface_color</item>
<item name="android:windowBackground">?attr/colorSurface</item>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Widget" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="colorPrimary">?android:attr/colorAccent</item>
<item name="colorSecondary">?android:attr/colorAccent</item>
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
<item name="colorSurface">@color/surface_color</item>
<item name="android:windowBackground">?attr/colorSurface</item>
<item name="android:colorBackground">?attr/colorSurface</item>
</style>
</resources>
+1
View File
@@ -12,6 +12,7 @@
<!-- Height Namespace | Height for UI elements -->
<dimen name="height_compact_progress">2dp</dimen>
<dimen name="height_minimal_btn">28dp</dimen>
<!-- Width Namespace | Width for UI elements -->
<dimen name="width_track_number">32dp</dimen>
+1
View File
@@ -126,6 +126,7 @@
<string name="description_error">Error</string>
<string name="description_auxio_icon">Auxio icon</string>
<string name="description_placeholder_cover">Album cover</string>
<string name="description_album_cover">Album Cover for %s</string>
<string name="description_artist_image">Artist Image for %s</string>
<string name="description_genre_image">Genre Image for %s</string>