mirror of
https://github.com/yattee/yattee.git
synced 2026-01-13 15:22:33 +00:00
Fix iOS fullscreen gesture collision with notification center
In fullscreen playback, swipe-down and timeline seek gestures now respect a 60pt safe zone at the top of the screen, allowing the system notification center gesture to work without triggering app gestures.
This commit is contained in:
@@ -6,6 +6,7 @@ enum Constants {
|
|||||||
static let overlayAnimation = Animation.linear(duration: 0.2)
|
static let overlayAnimation = Animation.linear(duration: 0.2)
|
||||||
static let aspectRatio16x9 = 16.0 / 9.0
|
static let aspectRatio16x9 = 16.0 / 9.0
|
||||||
static let aspectRatio4x3 = 4.0 / 3.0
|
static let aspectRatio4x3 = 4.0 / 3.0
|
||||||
|
static let notificationCenterZoneHeight: Double = 60
|
||||||
|
|
||||||
static var isAppleTV: Bool {
|
static var isAppleTV: Bool {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
|
|||||||
@@ -199,6 +199,16 @@ struct TimelineView: View {
|
|||||||
.gesture(
|
.gesture(
|
||||||
DragGesture(minimumDistance: 5, coordinateSpace: .global)
|
DragGesture(minimumDistance: 5, coordinateSpace: .global)
|
||||||
.onChanged { value in
|
.onChanged { value in
|
||||||
|
#if os(iOS)
|
||||||
|
// In fullscreen, ignore gestures that start in the top notification center area
|
||||||
|
// to allow system notification center gesture to work
|
||||||
|
if player.playingFullScreen {
|
||||||
|
if value.startLocation.y < Constants.notificationCenterZoneHeight {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if !dragging {
|
if !dragging {
|
||||||
controls.removeTimer()
|
controls.removeTimer()
|
||||||
draggedFrom = current
|
draggedFrom = current
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ extension VideoPlayerView {
|
|||||||
state = true
|
state = true
|
||||||
}
|
}
|
||||||
.onChanged { value in
|
.onChanged { value in
|
||||||
|
#if os(iOS)
|
||||||
|
// In fullscreen, ignore gestures that start in the top notification center area
|
||||||
|
// to allow system notification center gesture to work
|
||||||
|
if player.playingFullScreen {
|
||||||
|
if value.startLocation.y < Constants.notificationCenterZoneHeight {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
guard player.presentingPlayer,
|
guard player.presentingPlayer,
|
||||||
!controlsOverlayModel.presenting,
|
!controlsOverlayModel.presenting,
|
||||||
dragGestureState,
|
dragGestureState,
|
||||||
|
|||||||
Reference in New Issue
Block a user