mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Stay fullscreen when opening notification center
The upper 5% of the screen ignore swipe down gestures when in fullscreen, to avoid leaving fullscreen when opening the notification center. fixes #702 Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
af75afa912
commit
08c922f57c
@ -32,8 +32,12 @@ extension VideoPlayerView {
|
||||
let horizontalDrag = value.translation.width
|
||||
|
||||
#if os(iOS)
|
||||
if viewDragOffset > 0, !isVerticalDrag {
|
||||
isVerticalDrag = true
|
||||
// Detect if the gesture starts within the top 5% of the screen and the player is in fullscreen mode
|
||||
if value.startLocation.y <= UIScreen.main.bounds.height * 0.05, PlayerModel.shared.playingFullScreen {
|
||||
// If it's a downward swipe, do nothing (return early)
|
||||
if verticalDrag > 0, abs(verticalDrag) > abs(horizontalDrag) {
|
||||
return
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user