detail: fix playlist edit cover consistency
This commit is contained in:
@@ -208,6 +208,7 @@ class PlaylistDetailFragment :
|
|||||||
editedPlaylist,
|
editedPlaylist,
|
||||||
binding.context.getString(R.string.desc_playlist_image, playlist.name),
|
binding.context.getString(R.string.desc_playlist_image, playlist.name),
|
||||||
R.drawable.ic_playlist_24,
|
R.drawable.ic_playlist_24,
|
||||||
|
playlist.uid.toString().hashCode(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
binding.detailCover.bind(playlist)
|
binding.detailCover.bind(playlist)
|
||||||
|
|||||||
@@ -456,14 +456,20 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
|||||||
* @param songs The [Song]s to bind.
|
* @param songs The [Song]s to bind.
|
||||||
* @param desc The content description to describe the bound data.
|
* @param desc The content description to describe the bound data.
|
||||||
* @param errorRes The resource of the error drawable to use if the cover cannot be loaded.
|
* @param errorRes The resource of the error drawable to use if the cover cannot be loaded.
|
||||||
|
* @param uidSeed A seed for the z-order of the stack, to keep the visual consistent.
|
||||||
*/
|
*/
|
||||||
fun bind(songs: List<Song>, desc: String, @DrawableRes errorRes: Int) =
|
fun bind(
|
||||||
|
songs: List<Song>,
|
||||||
|
desc: String,
|
||||||
|
@DrawableRes errorRes: Int,
|
||||||
|
uidSeed: Int = songs.hashCode(),
|
||||||
|
) =
|
||||||
bindImpl(
|
bindImpl(
|
||||||
{
|
{
|
||||||
StackCoverCollection(
|
StackCoverCollection(
|
||||||
CoverCollection.from(songs.mapNotNull { it.cover }),
|
CoverCollection.from(songs.mapNotNull { it.cover }),
|
||||||
coverCollectionCornerRatio(),
|
coverCollectionCornerRatio(),
|
||||||
coverCollectionZOrder(songs.hashCode()),
|
coverCollectionZOrder(uidSeed),
|
||||||
coverCollectionBackgroundColor(),
|
coverCollectionBackgroundColor(),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user