1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-09 08:50:34 +00:00

Dismiss popup menu on clicking an option

This commit is contained in:
Isira Seneviratne 2024-07-28 17:21:36 +05:30
parent 06a5828bbe
commit 8e8f627097

View File

@ -34,6 +34,7 @@ fun StreamMenu(
DropdownMenuItem(
text = { Text(text = stringResource(R.string.download)) },
onClick = {
onDismissRequest()
SparseItemUtil.fetchStreamInfoAndSaveToDatabase(
context, stream.serviceId, stream.url
) { info: StreamInfo ->
@ -49,11 +50,17 @@ fun StreamMenu(
)
DropdownMenuItem(
text = { Text(text = stringResource(R.string.share)) },
onClick = { ShareUtils.shareText(context, stream.name, stream.url, stream.thumbnails) }
onClick = {
onDismissRequest()
ShareUtils.shareText(context, stream.name, stream.url, stream.thumbnails)
}
)
DropdownMenuItem(
text = { Text(text = stringResource(R.string.open_in_browser)) },
onClick = { ShareUtils.openUrlInBrowser(context, stream.url) }
onClick = {
onDismissRequest()
ShareUtils.openUrlInBrowser(context, stream.url)
}
)
DropdownMenuItem(
text = { Text(text = stringResource(R.string.mark_as_watched)) },