detail: fix album regressions
Fix the accidental navToItem breakage in AlbumDetailFragment.
This commit is contained in:
parent
0e0be19e1d
commit
cafd7d8ca6
2 changed files with 3 additions and 2 deletions
|
@ -155,9 +155,10 @@ class AlbumDetailFragment : DetailFragment() {
|
|||
*/
|
||||
private fun scrollToItem(id: Long, adapter: AlbumDetailAdapter) {
|
||||
// Calculate where the item for the currently played song is
|
||||
val pos = adapter.currentList.indexOfFirst { it.id == id && it is Album }
|
||||
val pos = adapter.currentList.indexOfFirst { it.id == id && it is Song }
|
||||
|
||||
if (pos != -1) {
|
||||
logD("IDIOT.")
|
||||
binding.detailRecycler.post {
|
||||
// Make sure to increment the position to make up for the detail header
|
||||
binding.detailRecycler.layoutManager?.startSmoothScroll(
|
||||
|
|
|
@ -148,7 +148,7 @@ class AlbumDetailAdapter(
|
|||
text = data.artist.name
|
||||
|
||||
setOnClickListener {
|
||||
detailModel.navToItem(data)
|
||||
detailModel.navToItem(data.artist)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue