diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressAction.kt b/app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressAction.kt index b051f9168..3ec82630b 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressAction.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressAction.kt @@ -44,6 +44,9 @@ import org.schabi.newpipe.player.playqueue.ChannelTabPlayQueue import org.schabi.newpipe.player.playqueue.PlayQueue import org.schabi.newpipe.player.playqueue.PlaylistPlayQueue import org.schabi.newpipe.player.playqueue.SinglePlayQueue +import org.schabi.newpipe.ui.components.menu.icons.BackgroundFromHere +import org.schabi.newpipe.ui.components.menu.icons.PlayFromHere +import org.schabi.newpipe.ui.components.menu.icons.PopupFromHere import org.schabi.newpipe.util.NavigationHelper import org.schabi.newpipe.util.SparseItemUtil import org.schabi.newpipe.util.external_communication.ShareUtils @@ -60,8 +63,11 @@ data class LongPressAction( Enqueue(R.string.enqueue, Icons.Default.AddToQueue), EnqueueNext(R.string.enqueue_next_stream, Icons.Default.QueuePlayNext), Background(R.string.controls_background_title, Icons.Default.Headset), + BackgroundFromHere(R.string.background_from_here, Icons.Default.BackgroundFromHere), Popup(R.string.controls_popup_title, Icons.Default.PictureInPicture), + PopupFromHere(R.string.popup_from_here, Icons.Default.PopupFromHere), Play(R.string.play, Icons.Default.PlayArrow), + PlayFromHere(R.string.play_from_here, Icons.Default.PlayFromHere), PlayWithKodi(R.string.play_with_kodi_title, Icons.Default.Cast), Download(R.string.download, Icons.Default.Download), AddToPlaylist(R.string.add_to_playlist, Icons.AutoMirrored.Default.PlaylistAdd), diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/BackgroundFromHere.kt b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/BackgroundFromHere.kt new file mode 100644 index 000000000..fd5972fcc --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/BackgroundFromHere.kt @@ -0,0 +1,70 @@ +@file:Suppress("UnusedReceiverParameter") + +package org.schabi.newpipe.ui.components.menu.icons + +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp + +/** + * Obtained by combining Filled.Headset and Filled.PlaylistPlay + */ +val Icons.Filled.BackgroundFromHere: ImageVector by lazy { + materialIcon(name = "Filled.HeadsetPlus") { + materialPath { + moveTo(7.200f, 0.000f) + curveToRelative(-3.976f, 0.000f, -7.200f, 3.224f, -7.200f, 7.200f) + verticalLineToRelative(5.600f) + curveToRelative(0.000f, 1.328f, 1.072f, 2.400f, 2.400f, 2.400f) + horizontalLineToRelative(2.400f) + verticalLineToRelative(-6.400f) + horizontalLineTo(1.600f) + verticalLineToRelative(-1.600f) + curveToRelative(0.000f, -3.096f, 2.504f, -5.600f, 5.600f, -5.600f) + reflectiveCurveToRelative(5.600f, 2.504f, 5.600f, 5.600f) + verticalLineToRelative(1.600f) + horizontalLineToRelative(-3.200f) + verticalLineToRelative(6.400f) + horizontalLineToRelative(2.400f) + curveToRelative(1.328f, 0.000f, 2.400f, -1.072f, 2.400f, -2.400f) + verticalLineToRelative(-5.600f) + curveToRelative(0.000f, -3.976f, -3.224f, -7.200f, -7.200f, -7.200f) + close() + } + materialPath { + moveTo(15.817f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + materialPath { + moveTo(20.100f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFFFFFFF) +@Composable +private fun BackgroundFromHerePreview() { + Icon( + imageVector = Icons.Filled.BackgroundFromHere, + contentDescription = null, + modifier = Modifier.size(240.dp), + ) +} diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PlayFromHere.kt b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PlayFromHere.kt new file mode 100644 index 000000000..160317f4a --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PlayFromHere.kt @@ -0,0 +1,56 @@ +@file:Suppress("UnusedReceiverParameter") + +package org.schabi.newpipe.ui.components.menu.icons + +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp + +/** + * Obtained by combining Filled.PlayArrow and Filled.PlaylistPlay + */ +val Icons.Filled.PlayFromHere: ImageVector by lazy { + materialIcon(name = "Filled.HeadsetPlus") { + materialPath { + moveTo(5.000f, 3.000f) + verticalLineToRelative(11.200f) + lineToRelative(8.800f, -5.600f) + close() + } + materialPath { + moveTo(15.817f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + materialPath { + moveTo(20.100f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFFFFFFF) +@Composable +private fun PlayFromHerePreview() { + Icon( + imageVector = Icons.Filled.PlayFromHere, + contentDescription = null, + modifier = Modifier.size(240.dp), + ) +} diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PopupFromHere.kt b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PopupFromHere.kt new file mode 100644 index 000000000..471593868 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/ui/components/menu/icons/PopupFromHere.kt @@ -0,0 +1,74 @@ +@file:Suppress("UnusedReceiverParameter") + +package org.schabi.newpipe.ui.components.menu.icons + +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp + +/** + * Obtained by combining Filled.PictureInPicture and Filled.PlaylistPlay + */ +val Icons.Filled.PopupFromHere: ImageVector by lazy { + materialIcon(name = "Filled.HeadsetPlus") { + materialPath { + moveTo(14.320f, 3.200f) + horizontalLineToRelative(-6.400f) + verticalLineToRelative(4.800f) + horizontalLineToRelative(6.400f) + lineTo(14.320f, 3.200f) + close() + moveTo(15.920f, 0.000f) + lineTo(1.520f, 0.000f) + curveToRelative(-0.880f, 0.000f, -1.600f, 0.720f, -1.600f, 1.600f) + verticalLineToRelative(11.200f) + curveToRelative(0.000f, 0.880f, 0.720f, 1.584f, 1.600f, 1.584f) + horizontalLineToRelative(14.400f) + curveToRelative(0.880f, 0.000f, 1.600f, -0.704f, 1.600f, -1.584f) + lineTo(17.520f, 1.600f) + curveToRelative(0.000f, -0.880f, -0.720f, -1.600f, -1.600f, -1.600f) + close() + moveTo(15.920f, 12.808f) + lineTo(1.520f, 12.808f) + lineTo(1.520f, 1.584f) + horizontalLineToRelative(14.400f) + verticalLineToRelative(11.224f) + close() + } + materialPath { + moveTo(15.817f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + materialPath { + moveTo(20.100f, 16.202f) + lineToRelative(-0.916f, 0.916f) + lineToRelative(2.977f, 2.983f) + lineToRelative(-2.977f, 2.983f) + lineToRelative(0.916f, 0.916f) + lineToRelative(3.900f, -3.900f) + close() + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFFFFFFF) +@Composable +private fun PopupFromHerePreview() { + Icon( + imageVector = Icons.Filled.PopupFromHere, + contentDescription = null, + modifier = Modifier.size(240.dp), + ) +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index af161f338..0c320fdf7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -900,4 +900,7 @@ HTTP error 403 received from server while playing, likely caused by an IP ban or streaming URL deobfuscation issues %1$s refused to provide data, asking for a login to confirm the requester is not a bot.\n\nYour IP might have been temporarily banned by %1$s, you can wait some time or switch to a different IP (for example by turning on/off a VPN, or by switching from WiFi to mobile data). This content is not available for the currently selected content country.\n\nChange your selection from \"Settings > Content > Default content country\". + Background\nfrom here + Popup\nfrom here + Play\nfrom here