music: rework callback configuration

Rework the asynchronous aspects of MusicStore to rely on a more
conventional callback system.

In preparation for automatic rescanning, it would be more elegant
for music consumers to use a callback, so that updates can be
registered easier than if a co-routine continued to be used.
Convert MusicStore to this new model and rework the accesses of
MusicStore in-app to line up with this new system.
This commit is contained in:
OxygenCobalt
2022-04-07 20:18:25 -06:00
parent 3a19d822ce
commit 180faa6f50
14 changed files with 218 additions and 257 deletions
@@ -18,7 +18,7 @@
<org.oxycblt.auxio.coil.StyledImageView
android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_large"
android:layout_margin="@dimen/spacing_mid_large"
app:layout_constraintBottom_toTopOf="@+id/playback_song"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -30,8 +30,8 @@
style="@style/Widget.Auxio.TextView.Primary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -43,8 +43,8 @@
style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
app:layout_constraintBottom_toTopOf="@+id/playback_album"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -55,8 +55,8 @@
style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -108,7 +108,7 @@
android:id="@+id/playback_loop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:contentDescription="@string/desc_change_loop"
android:src="@drawable/ic_loop"
app:hasIndicator="true"
@@ -121,7 +121,7 @@
android:id="@+id/playback_skip_prev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:contentDescription="@string/desc_skip_prev"
android:src="@drawable/ic_skip_prev"
app:layout_constraintBottom_toBottomOf="@+id/playback_play_pause"
@@ -133,7 +133,7 @@
style="@style/Widget.Auxio.FloatingActionButton.PlayPause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_mid_large"
android:contentDescription="@string/desc_play_pause"
android:src="@drawable/sel_playing_state"
app:layout_constraintBottom_toBottomOf="parent"
@@ -145,7 +145,7 @@
android:id="@+id/playback_skip_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:contentDescription="@string/desc_skip_next"
android:src="@drawable/ic_skip_next"
app:layout_constraintBottom_toBottomOf="@+id/playback_play_pause"
@@ -156,7 +156,7 @@
android:id="@+id/playback_shuffle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:contentDescription="@string/desc_shuffle"
android:src="@drawable/ic_shuffle"
app:hasIndicator="true"