forked from zelo72/mastodon-ios
fix: animate emoji label break VoiceOver issue
This commit is contained in:
parent
7806816213
commit
f43b36ddda
|
@ -106,21 +106,7 @@ extension StatusSection {
|
||||||
)
|
)
|
||||||
cell.delegate = statusTableViewCellDelegate
|
cell.delegate = statusTableViewCellDelegate
|
||||||
cell.isAccessibilityElement = true
|
cell.isAccessibilityElement = true
|
||||||
// FIXME:
|
StatusSection.configureStatusAccessibilityLabel(cell: cell)
|
||||||
cell.accessibilityLabel = {
|
|
||||||
var accessibilityViews: [UIView?] = []
|
|
||||||
if !cell.statusView.headerContainerView.isHidden {
|
|
||||||
accessibilityViews.append(cell.statusView.headerInfoLabel)
|
|
||||||
}
|
|
||||||
accessibilityViews.append(contentsOf: [
|
|
||||||
cell.statusView.nameMetaLabel,
|
|
||||||
cell.statusView.dateLabel,
|
|
||||||
cell.statusView.contentMetaText.textView,
|
|
||||||
])
|
|
||||||
return accessibilityViews
|
|
||||||
.compactMap { $0?.accessibilityLabel }
|
|
||||||
.joined(separator: " ")
|
|
||||||
}()
|
|
||||||
return cell
|
return cell
|
||||||
case .status(let objectID, let attribute),
|
case .status(let objectID, let attribute),
|
||||||
.root(let objectID, let attribute),
|
.root(let objectID, let attribute),
|
||||||
|
@ -182,7 +168,7 @@ extension StatusSection {
|
||||||
cell.accessibilityElements = accessibilityElements
|
cell.accessibilityElements = accessibilityElements
|
||||||
default:
|
default:
|
||||||
cell.isAccessibilityElement = true
|
cell.isAccessibilityElement = true
|
||||||
cell.accessibilityElements = nil
|
StatusSection.configureStatusAccessibilityLabel(cell: cell)
|
||||||
}
|
}
|
||||||
return cell
|
return cell
|
||||||
case .leafBottomLoader:
|
case .leafBottomLoader:
|
||||||
|
@ -1116,6 +1102,25 @@ extension StatusSection {
|
||||||
.store(in: &cell.disposeBag)
|
.store(in: &cell.disposeBag)
|
||||||
self.setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
self.setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static func configureStatusAccessibilityLabel(cell: StatusTableViewCell) {
|
||||||
|
// FIXME:
|
||||||
|
cell.accessibilityLabel = {
|
||||||
|
var accessibilityViews: [UIView?] = []
|
||||||
|
if !cell.statusView.headerContainerView.isHidden {
|
||||||
|
accessibilityViews.append(cell.statusView.headerInfoLabel)
|
||||||
|
}
|
||||||
|
accessibilityViews.append(contentsOf: [
|
||||||
|
cell.statusView.nameMetaLabel,
|
||||||
|
cell.statusView.dateLabel,
|
||||||
|
cell.statusView.contentMetaText.textView,
|
||||||
|
])
|
||||||
|
return accessibilityViews
|
||||||
|
.compactMap { $0?.accessibilityLabel }
|
||||||
|
.joined(separator: " ")
|
||||||
|
}()
|
||||||
|
cell.statusView.actionToolbarContainer.isUserInteractionEnabled = !UIAccessibility.isVoiceOverRunning
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,20 @@ class AppearanceView: UIView {
|
||||||
imageView.image = image
|
imageView.image = image
|
||||||
titleLabel.text = title
|
titleLabel.text = title
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override var isAccessibilityElement: Bool {
|
||||||
|
get { return true }
|
||||||
|
set { }
|
||||||
|
|
||||||
|
}
|
||||||
|
override var accessibilityLabel: String? {
|
||||||
|
get {
|
||||||
|
return [titleLabel.text, checkBox.accessibilityLabel]
|
||||||
|
.compactMap { $0 }
|
||||||
|
.joined(separator: ", ")
|
||||||
|
}
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
|
Loading…
Reference in New Issue