Heavily refactor music loading

Heavily change how music loading works so that artists arent redundantly loaded, genres are primarily song-based instead of genre based, and songs are now bound to their correct genres.
This commit is contained in:
OxygenCobalt
2020-12-20 15:30:50 -07:00
parent dc26d70088
commit 6e5bff3bd3
20 changed files with 264 additions and 488 deletions
@@ -54,7 +54,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_album" />
<androidx.appcompat.widget.AppCompatTextView
<TextView
android:id="@+id/album_name"
style="@style/DetailTitleText"
android:layout_width="0dp"
@@ -52,7 +52,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_artist" />
<androidx.appcompat.widget.AppCompatTextView
<TextView
android:id="@+id/artist_name"
style="@style/DetailTitleText"
android:layout_width="0dp"
@@ -53,7 +53,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_genre" />
<androidx.appcompat.widget.AppCompatTextView
<TextView
android:id="@+id/genre_name"
style="@style/DetailTitleText"
android:layout_width="0dp"
@@ -90,16 +90,16 @@
android:text="@{@plurals/format_song_count(genre.songs.size, genre.songs.size)}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toTopOf="@+id/genre_artist_header"
app:layout_constraintBottom_toTopOf="@+id/genre_song_header"
app:layout_constraintStart_toEndOf="@+id/genre_image"
app:layout_constraintTop_toBottomOf="@+id/genre_counts"
tools:text="80 Songs" />
<TextView
android:id="@+id/genre_artist_header"
android:id="@+id/genre_song_header"
style="@style/HeaderText"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/label_artists"
android:text="@string/label_songs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_image" />
@@ -108,13 +108,13 @@
style="@style/HeaderAction"
android:contentDescription="@string/description_sort_button"
android:onClick="@{() -> detailModel.incrementGenreSortMode()}"
app:layout_constraintBottom_toBottomOf="@+id/genre_artist_header"
app:layout_constraintBottom_toBottomOf="@+id/genre_song_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/genre_artist_header"
app:layout_constraintTop_toTopOf="@+id/genre_song_header"
tools:src="@drawable/ic_sort_alpha_down" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/genre_artist_recycler"
android:id="@+id/genre_song_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -123,10 +123,10 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_artist_header"
app:layout_constraintTop_toBottomOf="@+id/genre_song_header"
app:spanCount="2"
tools:itemCount="4"
tools:listitem="@layout/item_artist" />
tools:listitem="@layout/item_song" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -54,7 +54,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_album" />
<androidx.appcompat.widget.AppCompatTextView
<TextView
android:id="@+id/album_name"
style="@style/DetailTitleText"
android:layout_width="0dp"
@@ -53,7 +53,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_artist" />
<androidx.appcompat.widget.AppCompatTextView
<TextView
android:id="@+id/artist_name"
style="@style/DetailTitleText"
android:layout_width="0dp"
@@ -54,6 +54,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_genre" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/genre_name"
style="@style/DetailTitleText"
@@ -94,10 +95,10 @@
tools:text="80 Songs" />
<TextView
android:id="@+id/genre_artist_header"
android:id="@+id/genre_song_header"
style="@style/HeaderText"
android:layout_marginTop="@dimen/padding_medium"
android:text="@string/label_artists"
android:text="@string/label_songs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_song_count" />
@@ -106,13 +107,13 @@
style="@style/HeaderAction"
android:contentDescription="@string/description_sort_button"
android:onClick="@{() -> detailModel.incrementGenreSortMode()}"
app:layout_constraintBottom_toBottomOf="@+id/genre_artist_header"
app:layout_constraintBottom_toBottomOf="@+id/genre_song_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/genre_artist_header"
app:layout_constraintTop_toTopOf="@+id/genre_song_header"
tools:src="@drawable/ic_sort_alpha_down" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/genre_artist_recycler"
android:id="@+id/genre_song_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -121,9 +122,9 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_artist_header"
app:layout_constraintTop_toBottomOf="@+id/genre_song_header"
tools:itemCount="4"
tools:listitem="@layout/item_artist" />
tools:listitem="@layout/item_song" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
+2 -2
View File
@@ -38,12 +38,12 @@
<TextView
android:id="@+id/genre_count"
style="@style/ItemText.Secondary"
app:genreCounts="@{genre}"
app:altGenreCounts="@{genre}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/genre_image"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="2 Artists, 4 Albums" />
tools:text="4 Albums, 40 Songs" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>