added brightness bar and check desc.

https://discord.com/channels/1293430817841741899/1357429131054289118/1357442581784559847
This commit is contained in:
Seiike 2025-04-03 23:42:44 +02:00
parent 441cb22abc
commit 0f3ed42340
2 changed files with 20 additions and 8 deletions

View file

@ -98,7 +98,7 @@ struct VerticalBrightnessSlider<T: BinaryFloatingPoint>: View {
}
}
}
.frame(width: isActive ? width * 2.2 : width, alignment: .center)
.frame(width: isActive ? width * 1.9 : width, alignment: .center)
.offset(x: isActive ? -10 : 0)
.onChange(of: value) { newValue in
UIScreen.main.brightness = CGFloat(newValue)

View file

@ -419,7 +419,7 @@ class CustomMediaPlayerViewController: UIViewController {
func holdForPause() {
let holdForPauseGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleHoldForPause(_:)))
holdForPauseGesture.minimumPressDuration = 2.0
holdForPauseGesture.minimumPressDuration = 1
holdForPauseGesture.numberOfTouchesRequired = 2
view.addGestureRecognizer(holdForPauseGesture)
}
@ -437,7 +437,7 @@ class CustomMediaPlayerViewController: UIViewController {
activeFillColor: .white, // Preserves original active color
fillColor: .white.opacity(0.5), // Preserves original fill color
emptyColor: .white.opacity(0.3), // Preserves original empty color
width: 16, // Keeps the original width and corner style
width: 22, // Keeps the original width and corner style
onEditingChanged: { editing in
// Optionally handle editing events here.
}
@ -454,9 +454,9 @@ class CustomMediaPlayerViewController: UIViewController {
// Constrain the container so that its bounds follow the slider's visual position.
NSLayoutConstraint.activate([
brightnessContainer.leadingAnchor.constraint(equalTo: controlsContainerView.leadingAnchor, constant: 1.8),
brightnessContainer.leadingAnchor.constraint(equalTo: controlsContainerView.leadingAnchor, constant: -4),
brightnessContainer.centerYAnchor.constraint(equalTo: controlsContainerView.centerYAnchor, constant: -10),
brightnessContainer.widthAnchor.constraint(equalToConstant: 16),
brightnessContainer.widthAnchor.constraint(equalToConstant: 22),
brightnessContainer.heightAnchor.constraint(equalToConstant: 170)
])
@ -505,9 +505,8 @@ class CustomMediaPlayerViewController: UIViewController {
}
}
let swipeDownGesture = UISwipeGestureRecognizer(target: self, action: #selector(handleSwipeDown(_:)))
swipeDownGesture.direction = .down
view.addGestureRecognizer(swipeDownGesture)
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:)))
view.addGestureRecognizer(panGesture)
}
func showSkipFeedback(direction: String) {
@ -1465,6 +1464,19 @@ class CustomMediaPlayerViewController: UIViewController {
}
}
@objc private func handlePanGesture(_ gesture: UIPanGestureRecognizer) {
let translation = gesture.translation(in: view)
switch gesture.state {
case .ended:
if translation.y > 100 {
dismiss(animated: true, completion: nil)
}
default:
break
}
}
private func beginHoldSpeed() {
guard let player = player else { return }
originalRate = player.rate