fix(mobile): keep AirPlay button size and color consistent

This commit is contained in:
joshuafhiggins committed 2026-10-30 14:15:49 -04:00 Verified
1 parent cd9972724f
commit 29acdaccc2
1 file changed
+15 -2
@@ -7,24 +7,37 @@ public class AudioOutputModule: Module {
View(AudioOutputView.self) {
Prop("tint") { (view: AudioOutputView, color: UIColor) in
view.picker.tintColor = color
view.icon.tintColor = color
}
}
}
}
final class AudioOutputView: ExpoView {
let picker = AVRoutePickerView()
private let picker = AVRoutePickerView()
let icon = UIImageView(
image: UIImage(
systemName: "airplay.audio",
withConfiguration: UIImage.SymbolConfiguration(pointSize: 27, weight: .semibold)
)
)
required init(appContext: AppContext? = nil) {
super.init(appContext: appContext)
picker.prioritizesVideoDevices = false
picker.backgroundColor = .clear
// Keep the native picker interactive without its route-dependent icon styling.
picker.layer.opacity = 0
addSubview(picker)
icon.contentMode = .center
icon.isUserInteractionEnabled = false
icon.isAccessibilityElement = false
addSubview(icon)
}
override func layoutSubviews() {
super.layoutSubviews()
picker.frame = bounds
icon.frame = bounds
}
}