Merge pull request #2581 from Bnyro/master

Fix the layout of boomarked playlists in the library
This commit is contained in:
Bnyro 2023-01-04 18:22:04 +01:00 committed by GitHub
commit 83852514cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -7,7 +7,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.github.libretube.R
import com.github.libretube.databinding.PlaylistBookmarkRowBinding
import com.github.libretube.databinding.PlaylistRowBinding
import com.github.libretube.databinding.PlaylistsRowBinding
import com.github.libretube.db.DatabaseHolder
import com.github.libretube.db.obj.PlaylistBookmark
import com.github.libretube.enums.PlaylistType
@ -28,7 +28,7 @@ class PlaylistBookmarkAdapter(
PlaylistBookmarkRowBinding.inflate(layoutInflater, parent, false)
)
BookmarkMode.FRAGMENT -> PlaylistBookmarkViewHolder(
PlaylistRowBinding.inflate(layoutInflater, parent, false)
PlaylistsRowBinding.inflate(layoutInflater, parent, false)
)
}
}
@ -64,7 +64,10 @@ class PlaylistBookmarkAdapter(
}
}
holder.playlistBinding?.apply {
holder.playlistsBinding?.apply {
// hide the count of videos inside the playlist as it's not stored in the database
videoCount.visibility = View.GONE
var isBookmarked = true
ImageHelper.loadImage(bookmark.thumbnailUrl, playlistThumbnail)

View File

@ -2,17 +2,17 @@ package com.github.libretube.ui.viewholders
import androidx.recyclerview.widget.RecyclerView
import com.github.libretube.databinding.PlaylistBookmarkRowBinding
import com.github.libretube.databinding.PlaylistRowBinding
import com.github.libretube.databinding.PlaylistsRowBinding
class PlaylistBookmarkViewHolder : RecyclerView.ViewHolder {
var playlistBookmarkBinding: PlaylistBookmarkRowBinding? = null
var playlistBinding: PlaylistRowBinding? = null
var playlistsBinding: PlaylistsRowBinding? = null
constructor(binding: PlaylistBookmarkRowBinding) : super(binding.root) {
playlistBookmarkBinding = binding
}
constructor(binding: PlaylistRowBinding) : super(binding.root) {
playlistBinding = binding
constructor(binding: PlaylistsRowBinding) : super(binding.root) {
playlistsBinding = binding
}
}