From 826e054790ba1963fba5ef84c6fb7c244550914c Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 20 Nov 2022 16:30:50 +0100 Subject: [PATCH] fix the playlist bottomsheet items --- .../ui/sheets/PlaylistOptionsBottomSheet.kt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt index c502e38f2..80e6d01d9 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt @@ -33,17 +33,16 @@ class PlaylistOptionsBottomSheet( private val shareData = ShareData(currentPlaylist = playlistName) override fun onCreate(savedInstanceState: Bundle?) { // options for the dialog - var optionsList = listOf( - context?.getString(R.string.playOnBackground)!!, - context?.getString(R.string.clonePlaylist)!!, - context?.getString(R.string.share)!! + val optionsList = mutableListOf( + context?.getString(R.string.playOnBackground)!! ) - if (playlistType != PlaylistType.PUBLIC) { - optionsList = optionsList + - context?.getString(R.string.renamePlaylist)!! + - context?.getString(R.string.deletePlaylist)!! - - context?.getString(R.string.clonePlaylist)!! + if (playlistType == PlaylistType.PUBLIC) { + optionsList.add(context?.getString(R.string.share)!!) + optionsList.add(context?.getString(R.string.clonePlaylist)!!) + } else { + optionsList.add(context?.getString(R.string.renamePlaylist)!!) + optionsList.add(context?.getString(R.string.deletePlaylist)!!) } setSimpleItems(optionsList) { which ->