feat: add exit confirmation dialog to prevent accidental player exits#2838
Open
AiCurv wants to merge 1 commit into
Open
feat: add exit confirmation dialog to prevent accidental player exits#2838AiCurv wants to merge 1 commit into
AiCurv wants to merge 1 commit into
Conversation
Show a confirmation dialog when pressing back during playback, preventing accidental exits that would lose the buffered stream. - FullScreenPlayer: Replace instant popCurrentPage() with showExitConfirmDialog() that shows AlertDialog before exiting - DownloadedPlayerActivity: Replace instant finish() with showExitConfirmDialog() that shows AlertDialog before exiting - Add exit_player_confirm_title and exit_player_confirm_message string resources - Restore system UI (immersive mode) when dialog is dismissed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shows a confirmation dialog when pressing back during video playback, preventing accidental exits that would lose the buffered stream.
Currently, a single back press instantly exits the player, discarding the entire buffered stream. This is especially frustrating on devices with sensitive back buttons or gesture navigation where accidental presses are common.
Changes
FullScreenPlayer.kt
showExitConfirmDialog()method that shows anAlertDialogwith "Exit Player?" title and "Your buffered stream will be lost" messageactivity?.popCurrentPage("FullScreenPlayer")withshowExitConfirmDialog()in the back press handlerhideSystemUI()) when dialog is dismissed without exitingDownloadedPlayerActivity.kt
showExitConfirmDialog()method for external player intentsfinish()withshowExitConfirmDialog()in the back press callbackstrings.xml
exit_player_confirm_title("Exit Player?")exit_player_confirm_message("Your buffered stream will be lost. Are you sure you want to exit?")yesandnostring resources for dialog buttonsUser Experience
Before: Back press → instant exit, stream and buffer lost
After: Back press → confirmation dialog → user chooses Yes to exit or No to continue watching
The dialog uses the existing
AlertDialogCustomstyle for visual consistency with the rest of the app.Testing