mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Fix MediaView accessibility
This commit is contained in:
parent
042c496832
commit
7553b0aae6
@ -127,18 +127,18 @@ extension MediaView {
|
||||
case .image(let info):
|
||||
layoutImage()
|
||||
bindImage(configuration: configuration, info: info)
|
||||
accessibilityLabel = "Show image" // TODO: i18n
|
||||
accessibilityHint = "Expands the image. Double-tap and hold to show actions" // TODO: i18n
|
||||
case .gif(let info):
|
||||
layoutGIF()
|
||||
bindGIF(configuration: configuration, info: info)
|
||||
accessibilityLabel = "Show GIF" // TODO: i18n
|
||||
accessibilityHint = "Expands the GIF. Double-tap and hold to show actions" // TODO: i18n
|
||||
case .video(let info):
|
||||
layoutVideo()
|
||||
bindVideo(configuration: configuration, info: info)
|
||||
accessibilityLabel = "Show video player" // TODO: i18n
|
||||
accessibilityHint = "Shows video player. Double-tap and hold to show actions" // TODO: i18n
|
||||
}
|
||||
|
||||
accessibilityHint = "Tap then hold to show menu" // TODO: i18n
|
||||
accessibilityTraits.insert([.button, .image])
|
||||
|
||||
layoutBlurhash()
|
||||
bindBlurhash(configuration: configuration)
|
||||
@ -167,6 +167,8 @@ extension MediaView {
|
||||
self.imageView.image = image
|
||||
}
|
||||
.store(in: &configuration.disposeBag)
|
||||
|
||||
accessibilityLabel = info.altDescription
|
||||
if #available(iOS 15.0, *) {
|
||||
altViewController.rootView.altDescription = info.altDescription
|
||||
}
|
||||
@ -192,6 +194,8 @@ extension MediaView {
|
||||
|
||||
// auto play for GIF
|
||||
player.play()
|
||||
|
||||
accessibilityLabel = info.altDescription
|
||||
if #available(iOS 15.0, *) {
|
||||
altViewController.rootView.altDescription = info.altDescription
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user