diff --git a/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt index 3917a0028..54180e3eb 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt @@ -8,7 +8,11 @@ import com.github.libretube.constants.IntentData import com.github.libretube.db.DatabaseHolder import com.github.libretube.db.obj.Download import com.github.libretube.db.obj.DownloadItem +import com.github.libretube.enums.ShareObjectType +import com.github.libretube.helpers.NavigationHelper +import com.github.libretube.obj.ShareData import com.github.libretube.services.OfflinePlayerService +import com.github.libretube.ui.dialogs.ShareDialog import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlin.io.path.deleteIfExists import kotlinx.coroutines.Dispatchers @@ -20,7 +24,12 @@ class DownloadOptionsBottomSheet( private val onDelete: () -> Unit ) : BaseBottomSheet() { override fun onCreate(savedInstanceState: Bundle?) { - val options = listOf(R.string.playOnBackground, R.string.delete).map { getString(it) } + val options = listOf( + R.string.playOnBackground, + R.string.go_to_video, + R.string.share, + R.string.delete + ).map { getString(it) } setSimpleItems(options) { selectedIndex -> when (selectedIndex) { 0 -> { @@ -29,6 +38,14 @@ class DownloadOptionsBottomSheet( ContextCompat.startForegroundService(requireContext(), playerIntent) } 1 -> { + NavigationHelper.navigateVideo(requireContext(), videoId = download.videoId) + } + 2 -> { + val shareData = ShareData(currentVideo = download.uploader) + ShareDialog(download.videoId, ShareObjectType.VIDEO, shareData) + .show(parentFragmentManager, null) + } + 3 -> { MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.delete) .setMessage(R.string.irreversible) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0eeefe5e6..ea0455989 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -463,6 +463,7 @@ Play automatically Start playing video automatically when selecting Enter/exit fullscreen gestures + Go to video Download Service