v2 #1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user