mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 18:24:02 +00:00
Close overlay with tap outside
This commit is contained in:
@@ -10,7 +10,15 @@ struct PlayerGestures: View {
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
model.toggle()
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
doubleTapAction: {
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(-10))
|
||||
@@ -24,7 +32,15 @@ struct PlayerGestures: View {
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
model.toggle()
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
doubleTapAction: {
|
||||
player.backend.togglePlay()
|
||||
@@ -38,7 +54,15 @@ struct PlayerGestures: View {
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
model.toggle()
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
doubleTapAction: {
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(10))
|
||||
|
Reference in New Issue
Block a user