From 3943a879662a22f7444226a7cc39cd1c7a542c06 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Tue, 21 Jan 2025 06:23:02 +0530 Subject: [PATCH] Fix preview issue --- .../ui/components/items/stream/StreamItemPreviewProvider.kt | 6 +++--- .../schabi/newpipe/ui/components/items/stream/StreamMenu.kt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamItemPreviewProvider.kt b/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamItemPreviewProvider.kt index 9e57fe6ce28..e2f698ade77 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamItemPreviewProvider.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamItemPreviewProvider.kt @@ -6,8 +6,8 @@ import org.schabi.newpipe.ui.components.items.Stream internal class StreamItemPreviewProvider : PreviewParameterProvider { override val values = sequenceOf( - Stream(type = StreamType.NONE, uploaderName = "Uploader"), - Stream(type = StreamType.LIVE_STREAM), - Stream(type = StreamType.AUDIO_LIVE_STREAM), + Stream(type = StreamType.NONE, name = "Stream", uploaderName = "Uploader"), + Stream(type = StreamType.LIVE_STREAM, name = "Stream", uploaderName = "Uploader"), + Stream(type = StreamType.AUDIO_LIVE_STREAM, name = "Stream", uploaderName = "Uploader"), ) } diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamMenu.kt b/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamMenu.kt index 7810cbaa95d..f718cad63ea 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamMenu.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamMenu.kt @@ -30,10 +30,11 @@ fun StreamMenu( ) { val info = stream.toStreamInfoItem() val context = LocalContext.current - val streamViewModel = viewModel() val playerHolder = PlayerHolder.getInstance() DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) { + val streamViewModel = viewModel() + if (playerHolder.isPlayQueueReady) { StreamMenuItem( text = R.string.enqueue_stream,