Simplify genre visibility logic per code review
Co-authored-by: OxygenCobalt <65370175+OxygenCobalt@users.noreply.github.com>
This commit is contained in:
co-authored by
OxygenCobalt
parent
bb3fa36922
commit
d96a089a9e
@@ -150,11 +150,9 @@ class ArtistDetailFragment : DetailFragment<Artist, Music>() {
|
|||||||
// Information about the artist's genre(s) map to the sub-head text
|
// Information about the artist's genre(s) map to the sub-head text
|
||||||
// Hide the subhead if all genres are unknown (no genre tags in music files)
|
// Hide the subhead if all genres are unknown (no genre tags in music files)
|
||||||
val hasKnownGenres = artist.genres.any { it.name is Name.Known }
|
val hasKnownGenres = artist.genres.any { it.name is Name.Known }
|
||||||
binding.detailSubhead.apply {
|
binding.detailSubhead.isVisible = hasKnownGenres
|
||||||
isVisible = hasKnownGenres
|
if (hasKnownGenres) {
|
||||||
if (hasKnownGenres) {
|
binding.detailSubhead.text = artist.genres.resolveNames(context)
|
||||||
text = artist.genres.resolveNames(context)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In the case that this header used to he configured to have no songs,
|
// In the case that this header used to he configured to have no songs,
|
||||||
|
|||||||
Reference in New Issue
Block a user