Fix the layout of boomarked playlists in the library

This commit is contained in:
Bnyro 2023-01-04 18:21:07 +01:00
parent 56f8fdf84f
commit c3182edc73
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 androidx.recyclerview.widget.RecyclerView
import com.github.libretube.R import com.github.libretube.R
import com.github.libretube.databinding.PlaylistBookmarkRowBinding 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.DatabaseHolder
import com.github.libretube.db.obj.PlaylistBookmark import com.github.libretube.db.obj.PlaylistBookmark
import com.github.libretube.enums.PlaylistType import com.github.libretube.enums.PlaylistType
@ -28,7 +28,7 @@ class PlaylistBookmarkAdapter(
PlaylistBookmarkRowBinding.inflate(layoutInflater, parent, false) PlaylistBookmarkRowBinding.inflate(layoutInflater, parent, false)
) )
BookmarkMode.FRAGMENT -> PlaylistBookmarkViewHolder( 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 var isBookmarked = true
ImageHelper.loadImage(bookmark.thumbnailUrl, playlistThumbnail) ImageHelper.loadImage(bookmark.thumbnailUrl, playlistThumbnail)

View File

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