Merge pull request #3358 from Bnyro/master

Move back in navigation after deleting playlist
This commit is contained in:
Bnyro 2023-03-23 19:54:01 +01:00 committed by GitHub
commit 1288cf9f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class PlaylistAdapter(
private val playlistType: PlaylistType
) : RecyclerView.Adapter<PlaylistViewHolder>() {
var visibleCount = minOf(20, videoFeed.size)
private var visibleCount = minOf(20, videoFeed.size)
override fun getItemCount(): Int {
return when (playlistType) {

View File

@ -9,6 +9,7 @@ import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -128,7 +129,9 @@ class PlaylistFragment : Fragment() {
// show playlist options
binding.optionsMenu.setOnClickListener {
PlaylistOptionsBottomSheet(playlistId!!, playlistName ?: "", playlistType).show(
PlaylistOptionsBottomSheet(playlistId!!, playlistName.orEmpty(), playlistType) {
findNavController().popBackStack()
}.show(
childFragmentManager,
PlaylistOptionsBottomSheet::class.java.name
)