detail: fix album regressions
Fix the accidental navToItem breakage in AlbumDetailFragment.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user