mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Controls layouts, gestures and settings
This commit is contained in:
@@ -22,10 +22,13 @@ struct TVControls: UIViewRepresentable {
|
||||
let downSwipe = UISwipeGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handleSwipeDown(sender:)))
|
||||
downSwipe.direction = .down
|
||||
|
||||
let tap = UITapGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handleTap(sender:)))
|
||||
|
||||
controlsArea.addGestureRecognizer(leftSwipe)
|
||||
controlsArea.addGestureRecognizer(rightSwipe)
|
||||
controlsArea.addGestureRecognizer(upSwipe)
|
||||
controlsArea.addGestureRecognizer(downSwipe)
|
||||
controlsArea.addGestureRecognizer(tap)
|
||||
|
||||
let controls = UIHostingController(rootView: PlayerControls(player: player, thumbnails: thumbnails))
|
||||
controls.view.frame = .init(
|
||||
@@ -67,5 +70,11 @@ struct TVControls: UIViewRepresentable {
|
||||
@objc func handleSwipeDown(sender _: UISwipeGestureRecognizer) {
|
||||
model.reporter.send("swipe down")
|
||||
}
|
||||
|
||||
@objc func handleTap(sender _: UITapGestureRecognizer) {
|
||||
if !model.presentingControls, model.player.playerTime.seekOSDDismissed {
|
||||
model.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user