image: disable mosaics for album covers
generally albums dont make sense to have mosaics due to their covers being homogenous most often. so, use the most prominent cover instead.
This commit is contained in:
@@ -326,11 +326,23 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
||||
*
|
||||
* @param album The [Album] to bind to the view.
|
||||
*/
|
||||
fun bind(album: Album) =
|
||||
fun bind(album: Album) {
|
||||
// Generally it's not desirable for many albums to show all of their covers since unlike
|
||||
// artists/genres they don't really change.
|
||||
// Therefore just pick the most "prominent" cover (the one with the most instances) and load
|
||||
// that like you would a song instead.
|
||||
val mostProminentCover =
|
||||
album.covers.covers
|
||||
.groupBy { it.id }
|
||||
.maxByOrNull { it.value.size }
|
||||
?.value
|
||||
?.firstOrNull()
|
||||
|
||||
bindImpl(
|
||||
album.covers,
|
||||
mostProminentCover,
|
||||
context.getString(R.string.desc_album_cover, album.name),
|
||||
R.drawable.ic_album_24)
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind an [Artist]'s image to this view.
|
||||
|
||||
Reference in New Issue
Block a user