feat: draggable PiP with fullscreen toggle#415
Merged
Conversation
Use a Popup window so the floating player renders in its own window layer, guaranteeing it stays above inline video AndroidViews in the feed. Add drag gesture support with screen-edge clamping so users can reposition the mini player anywhere on screen.
…ering The Popup-based approach caused the PiP to vanish. Revert to the original Box overlay with AnimatedVisibility, using a FrameLayout wrapper with high translationZ to ensure the PiP PlayerView renders above inline video AndroidViews in the feed.
translationZ doesn't work across different Android ViewGroup parents. Switch to an Android Dialog which creates its own window layer, ensuring the PiP player always renders above inline video views in the feed. Drag repositioning uses window attribute manipulation instead of Compose offset for reliable positioning within the Dialog window.
Fullscreen now expands the PiP dialog to full screen instead of opening a separate FullScreenVideoPlayer with a new ExoPlayer. Back button or the mini player button returns to PiP mode. This keeps the same player instance throughout, so playback never interrupts or orphans.
Remove the Dialog-based approach which caused multiple issues. Restore the original AnimatedVisibility Box overlay which was stable, adding only the drag gesture for repositioning. The PiP may go behind inline video AndroidViews but is otherwise reliable.
When expanding PiP to fullscreen, the same ExoPlayer is reused. The fullscreen view now has a mini player button to return to PiP. Pressing back or closing the fullscreen also returns to PiP instead of stopping playback entirely.
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
Test plan