Hide empty tab player accessory
This commit is contained in:
1 parent
875045a4a9
commit
f4721a5a21
2 files changed
+105
-9
No files matched your search
@@ -20,18 +20,15 @@ struct PlayerBottomAccessoryView: View {
|
||||
)
|
||||
.padding(.horizontal, placement == .inline ? 4 : 0)
|
||||
.frame(maxWidth: placement == .inline ? 320 : .infinity)
|
||||
.glassEffect(.regular.tint(.black.opacity(0.18)), in: Capsule())
|
||||
.glassEffect(
|
||||
player.currentTrack == nil ? .clear : .regular.tint(.black.opacity(0.18)),
|
||||
in: Capsule()
|
||||
)
|
||||
.shadow(color: .black.opacity(placement == .inline ? 0 : 0.08), radius: 8, y: 3)
|
||||
.offset(y: 1 / displayScale)
|
||||
.opacity(player.currentTrack == nil ? 0 : 1)
|
||||
.overlay {
|
||||
Capsule()
|
||||
.fill(.black)
|
||||
.padding(-5)
|
||||
.opacity(player.currentTrack == nil ? 1 : 0)
|
||||
.allowsHitTesting(false)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
.allowsHitTesting(player.currentTrack != nil)
|
||||
.accessibilityHidden(player.currentTrack == nil)
|
||||
.animation(.snappy(duration: 0.25), value: player.currentTrack?.id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user