iOS: add swipe gestures to mini player — up to expand, down to dismiss
Some checks failed
CI / UI / Build (pull_request) Failing after 6s
CI / Scraper / Test (pull_request) Failing after 8s
CI / Scraper / Lint (pull_request) Failing after 10s
CI / Scraper / Build (pull_request) Has been skipped
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Build (pull_request) Failing after 2s
iOS CI / Test (pull_request) Has been skipped

This commit is contained in:
Admin
2026-03-07 23:02:57 +05:00
parent 228d4902bb
commit 603cd2bb02

View File

@@ -63,7 +63,7 @@ struct MiniPlayerView: View {
.foregroundStyle(.red)
.frame(width: 36, height: 36)
default:
Color.clear.frame(width: 36, height: 36)
EmptyView()
}
}
@@ -81,6 +81,18 @@ struct MiniPlayerView: View {
}
.background(.ultraThinMaterial)
.shadow(color: .black.opacity(0.15), radius: 6, y: -2)
.gesture(
DragGesture(minimumDistance: 20, coordinateSpace: .local)
.onEnded { value in
if value.translation.height < -20 {
// Swipe up expand full player
showFullPlayer = true
} else if value.translation.height > 20 {
// Swipe down dismiss
audioPlayer.stop()
}
}
)
}
private var progress: CGFloat {