mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Details panels in controls
This commit is contained in:
@@ -9,17 +9,7 @@ struct PlayerGestures: View {
|
||||
gestureRectangle
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation(PlayerControls.animation) {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
singleTapAction: { singleTapAction() },
|
||||
doubleTapAction: {
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(-10))
|
||||
},
|
||||
@@ -31,17 +21,7 @@ struct PlayerGestures: View {
|
||||
gestureRectangle
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation(PlayerControls.animation) {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
singleTapAction: { singleTapAction() },
|
||||
doubleTapAction: {
|
||||
player.backend.togglePlay()
|
||||
},
|
||||
@@ -53,17 +33,7 @@ struct PlayerGestures: View {
|
||||
gestureRectangle
|
||||
.tapRecognizer(
|
||||
tapSensitivity: 0.2,
|
||||
singleTapAction: {
|
||||
if model.presentingControlsOverlay {
|
||||
model.presentingControls = true
|
||||
model.resetTimer()
|
||||
withAnimation(PlayerControls.animation) {
|
||||
model.presentingControlsOverlay = false
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
},
|
||||
singleTapAction: { singleTapAction() },
|
||||
doubleTapAction: {
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(10))
|
||||
},
|
||||
@@ -74,6 +44,16 @@ struct PlayerGestures: View {
|
||||
}
|
||||
}
|
||||
|
||||
func singleTapAction() {
|
||||
if model.presentingOverlays {
|
||||
withAnimation(PlayerControls.animation) {
|
||||
model.hideOverlays()
|
||||
}
|
||||
} else {
|
||||
model.toggle()
|
||||
}
|
||||
}
|
||||
|
||||
var gestureRectangle: some View {
|
||||
Color.clear
|
||||
.contentShape(Rectangle())
|
||||
|
Reference in New Issue
Block a user