detail: add playing indicator to genre artists
Add playing indicators to artists within the genre detail view.
This commit is contained in:
parent
aa50c82635
commit
d764cc7c4e
2 changed files with 11 additions and 7 deletions
|
@ -98,7 +98,6 @@ class DetailViewModel(application: Application) :
|
||||||
var artistSort: Sort
|
var artistSort: Sort
|
||||||
get() = settings.detailArtistSort
|
get() = settings.detailArtistSort
|
||||||
set(value) {
|
set(value) {
|
||||||
logD(value)
|
|
||||||
settings.detailArtistSort = value
|
settings.detailArtistSort = value
|
||||||
currentArtist.value?.let(::refreshArtistData)
|
currentArtist.value?.let(::refreshArtistData)
|
||||||
}
|
}
|
||||||
|
@ -227,7 +226,7 @@ class DetailViewModel(application: Application) :
|
||||||
for (entry in byDisc.entries) {
|
for (entry in byDisc.entries) {
|
||||||
val disc = entry.key
|
val disc = entry.key
|
||||||
val discSongs = entry.value
|
val discSongs = entry.value
|
||||||
data.add(DiscHeader(disc)) // Ensure ID uniqueness
|
data.add(DiscHeader(disc))
|
||||||
data.addAll(discSongs)
|
data.addAll(discSongs)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -203,11 +203,16 @@ class GenreDetailFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updatePlayback(song: Song?, parent: MusicParent?, isPlaying: Boolean) {
|
private fun updatePlayback(song: Song?, parent: MusicParent?, isPlaying: Boolean) {
|
||||||
if (parent is Genre && parent == unlikelyToBeNull(detailModel.currentGenre.value)) {
|
var item: Item? = null
|
||||||
detailAdapter.updateIndicator(song, isPlaying)
|
|
||||||
} else {
|
if (parent is Artist) {
|
||||||
// Ignore song playback not from the genre
|
item = parent
|
||||||
detailAdapter.updateIndicator(null, isPlaying)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parent is Genre && parent.uid == unlikelyToBeNull(detailModel.currentGenre.value).uid) {
|
||||||
|
item = song
|
||||||
|
}
|
||||||
|
|
||||||
|
detailAdapter.updateIndicator(item, isPlaying)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue