File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
app/src/main/java/org/schabi/newpipe/ui/components/menu Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
2121import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
2222import org.schabi.newpipe.R
2323import org.schabi.newpipe.database.stream.model.StreamEntity
24+ import org.schabi.newpipe.download.DownloadDialog
2425import org.schabi.newpipe.extractor.InfoItem
2526import org.schabi.newpipe.extractor.stream.StreamInfoItem
2627import org.schabi.newpipe.ktx.findFragmentActivity
@@ -107,7 +108,16 @@ data class LongPressAction(
107108 return buildPlayerActionList { SinglePlayQueue (item) } +
108109 buildShareActionList(item) +
109110 listOf (
110- Type .Download .buildAction { context -> /* TODO */ },
111+ Type .Download .buildAction { context ->
112+ SparseItemUtil .fetchStreamInfoAndSaveToDatabase(
113+ context, item.serviceId, item.url
114+ ) { info ->
115+ val downloadDialog = DownloadDialog (context, info)
116+ val fragmentManager = context.findFragmentActivity()
117+ .supportFragmentManager
118+ downloadDialog.show(fragmentManager, " downloadDialog" )
119+ }
120+ },
111121 Type .AddToPlaylist .buildAction { context ->
112122 PlaylistDialog .createCorrespondingDialog(
113123 context,
You can’t perform that action at this time.
0 commit comments