coil: update image behavior

Update the image behavior for the following:
1. Use ic_album as the default image for songs and albums this just
looks beter in general.
2. Use a special default drawable for the widget so that it doesn't
look as strange.
3. Generally update the loading process throughout the app
This commit is contained in:
OxygenCobalt
2021-11-14 16:23:25 -07:00
parent d4fa52ee13
commit 1ea3ddb2e0
31 changed files with 158 additions and 112 deletions
@@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:tint="?attr/colorPrimary"
android:viewportWidth="24"
android:viewportHeight="24">
<path
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<!--
Special album icon where the center is filled with the surface color.
This is used for widgets specifically, as it creates a contiguous surface
that looks nicer on the small widgets while also lining up with the preview.
This does cause issues when the theme is changed on older android versions, but
this is tolerable.
-->
<path
android:fillColor="?attr/colorPrimary"
android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14.5c-2.49 0-4.5-2.01-4.5-4.5S9.51 7.5 12 7.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-5.5c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1z" />
<path
android:fillColor="?attr/colorSurface"
android:pathData="M 11.999988,7.5000052 C 10.26837,7.4769007 8.5915309,8.560755 7.896993,10.146219 c -0.7453054,1.607465 -0.4180795,3.637951 0.8068934,4.921183 1.166041,1.284666 3.1054606,1.767719 4.7412966,1.196892 1.694811,-0.550604 2.957738,-2.193714 3.045894,-3.974751 0.132222,-1.713727 -0.824064,-3.4451124 -2.343934,-4.2469378 -0.655277,-0.3575862 -1.401101,-0.5431647 -2.147155,-0.5426 z m 0,3.5000448 c 0.727249,-0.03179 1.254295,0.852995 0.879019,1.475902 -0.300918,0.612861 -1.237867,0.707058 -1.649512,0.15916 -0.489216,-0.537264 -0.143543,-1.499245 0.56999,-1.614362 0.06589,-0.01409 0.133207,-0.02062 0.200503,-0.0207 z" />
</vector>
@@ -45,7 +45,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<!-- TextView is wrapped in a container so that marquee doesn't break -->
@@ -47,7 +47,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<!-- TextView is wrapped in a container so that marquee doesn't break -->
@@ -46,7 +46,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/playback_song"
+4 -4
View File
@@ -165,12 +165,12 @@
style="@style/Widget.Auxio.TextView.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Auxio.Neutral"
app:drawableStartCompat="@drawable/ic_song"
app:drawableStartCompat="@drawable/ic_album"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/about_licenses"
tools:text="Songs Loaded: 1616" />
tools:text="Songs Loaded: 1616"
app:drawableTint="?attr/colorControlNormal" />
<TextView
android:id="@+id/about_author"
@@ -178,7 +178,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_author"
android:theme="@style/Theme.Auxio.Neutral"
app:drawableTint="?attr/colorControlNormal"
app:drawableStartCompat="@drawable/ic_artist"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -45,7 +45,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/playback_song"
+1 -1
View File
@@ -21,7 +21,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/song_name"
+1 -1
View File
@@ -21,7 +21,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/song_name"
+1 -1
View File
@@ -47,7 +47,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/song_name"
+1 -1
View File
@@ -22,7 +22,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/song_name"
@@ -26,7 +26,7 @@
app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_song" />
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/playback_song"
+2 -1
View File
@@ -14,7 +14,8 @@
android:alpha="0.275"
android:contentDescription="@string/desc_no_cover"
android:scaleType="centerCrop"
android:src="@drawable/ic_song" />
android:src="@drawable/ic_auxio"
android:tint="?attr/colorPrimary" />
<android.widget.TextView
android:layout_width="match_parent"
+1 -1
View File
@@ -43,7 +43,7 @@
android:layout_alignTop="@id/widget_aspect_ratio"
android:layout_alignEnd="@id/widget_aspect_ratio"
android:layout_alignBottom="@id/widget_aspect_ratio"
android:src="@drawable/ic_song"
android:src="@drawable/ic_widget_album"
tools:ignore="ContentDescription" />
<android.widget.LinearLayout
+1 -1
View File
@@ -43,7 +43,7 @@
android:layout_alignTop="@id/widget_aspect_ratio"
android:layout_alignEnd="@id/widget_aspect_ratio"
android:layout_alignBottom="@id/widget_aspect_ratio"
android:src="@drawable/ic_song"
android:src="@drawable/ic_widget_album"
tools:ignore="ContentDescription" />
<android.widget.LinearLayout
+5 -2
View File
@@ -45,7 +45,7 @@
android:layout_alignTop="@id/widget_aspect_ratio"
android:layout_alignEnd="@id/widget_aspect_ratio"
android:layout_alignBottom="@id/widget_aspect_ratio"
android:src="@drawable/ic_song"
android:src="@drawable/ic_widget_album"
tools:ignore="ContentDescription" />
<android.widget.LinearLayout
@@ -53,7 +53,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="@dimen/spacing_small"
android:paddingTop="@dimen/spacing_small"
android:paddingBottom="@dimen/spacing_small"
android:paddingStart="@dimen/spacing_medium"
android:paddingEnd="@dimen/spacing_medium"
android:elevation="@dimen/elevation_normal"
android:orientation="horizontal"
android:background="@drawable/ui_widget_panel"
+1 -1
View File
@@ -26,7 +26,7 @@
android:layout_marginEnd="@dimen/spacing_medium"
android:contentDescription="@string/desc_no_cover"
android:scaleType="centerCrop"
android:src="@drawable/ic_song" />
android:src="@drawable/ic_widget_album" />
<android.widget.LinearLayout
android:layout_width="0dp"
+5 -2
View File
@@ -45,7 +45,7 @@
android:layout_alignTop="@id/widget_aspect_ratio"
android:layout_alignEnd="@id/widget_aspect_ratio"
android:layout_alignBottom="@id/widget_aspect_ratio"
android:src="@drawable/ic_song"
android:src="@drawable/ic_widget_album"
tools:ignore="ContentDescription" />
<android.widget.LinearLayout
@@ -57,7 +57,10 @@
android:background="@drawable/ui_widget_panel"
android:elevation="@dimen/elevation_normal"
android:orientation="horizontal"
android:padding="@dimen/spacing_small">
android:paddingTop="@dimen/spacing_small"
android:paddingBottom="@dimen/spacing_small"
android:paddingStart="@dimen/spacing_medium"
android:paddingEnd="@dimen/spacing_medium">
<android.widget.ImageButton
android:id="@+id/widget_loop"
@@ -5,6 +5,5 @@
android:title="@string/lbl_queue_add" />
<item
android:id="@+id/action_go_album"
android:icon="@drawable/ic_album"
android:title="@string/lbl_go_album" />
</menu>
@@ -5,10 +5,8 @@
android:title="@string/lbl_queue_add" />
<item
android:id="@+id/action_go_artist"
android:icon="@drawable/ic_artist"
android:title="@string/lbl_go_artist" />
<item
android:id="@+id/action_go_album"
android:icon="@drawable/ic_album"
android:title="@string/lbl_go_album" />
</menu>
@@ -83,5 +83,7 @@
<item name="colorSecondary">?android:attr/colorAccent</item>
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
<item name="colorSurfaceInverse">@color/m3_sys_color_dynamic_dark_inverse_surface</item>
<item name="colorOnSurfaceInverse">@color/m3_sys_color_dynamic_dark_inverse_on_surface</item>
</style>
</resources>
@@ -83,5 +83,7 @@
<item name="colorSecondary">?android:attr/colorAccent</item>
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
<item name="colorSurfaceInverse">@color/m3_sys_color_dynamic_light_inverse_surface</item>
<item name="colorOnSurfaceInverse">@color/m3_sys_color_dynamic_light_inverse_on_surface</item>
</style>
</resources>
+1 -3
View File
@@ -7,9 +7,7 @@
<item name="android:statusBarColor">@android:color/black</item>
</style>
<!-- Android 12 configuration -->
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V27">
</style>
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V27" />
<!-- Base theme -->
<style name="Theme.Auxio.App" parent="Theme.Auxio.V31">