Compare commits
No commits in common. "7763d08816ada88fd87ada080ac489e4d034b571" and "df07fa85d5f727445c966177698a2ec98c068acf" have entirely different histories.
7763d08816
...
df07fa85d5
|
@ -150,7 +150,6 @@ class ProfileHeaderView: UIView {
|
||||||
accessibilityElements = [
|
accessibilityElements = [
|
||||||
displayNameLabel!,
|
displayNameLabel!,
|
||||||
usernameLabel!,
|
usernameLabel!,
|
||||||
relationshipLabel!,
|
|
||||||
noteTextView!,
|
noteTextView!,
|
||||||
fieldsView!,
|
fieldsView!,
|
||||||
moreButton!,
|
moreButton!,
|
||||||
|
|
|
@ -26,12 +26,12 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
@IBOutlet weak var totalReblogsButton: UIButton!
|
@IBOutlet weak var totalReblogsButton: UIButton!
|
||||||
@IBOutlet weak var timestampAndClientLabel: UILabel!
|
@IBOutlet weak var timestampAndClientLabel: UILabel!
|
||||||
|
|
||||||
private var profileAccessibilityElement: ConversationMainStatusProfileAccessibilityElement!
|
var profileAccessibilityElement: UIAccessibilityElement!
|
||||||
|
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
super.awakeFromNib()
|
super.awakeFromNib()
|
||||||
|
|
||||||
profileAccessibilityElement = ConversationMainStatusProfileAccessibilityElement(accessibilityContainer: self)
|
profileAccessibilityElement = UIAccessibilityElement(accessibilityContainer: self)
|
||||||
profileAccessibilityElement.accessibilityFrameInContainerSpace = profileDetailContainerView.convert(profileDetailContainerView.frame, to: self)
|
profileAccessibilityElement.accessibilityFrameInContainerSpace = profileDetailContainerView.convert(profileDetailContainerView.frame, to: self)
|
||||||
accessibilityElements = [
|
accessibilityElements = [
|
||||||
profileAccessibilityElement!,
|
profileAccessibilityElement!,
|
||||||
|
@ -101,8 +101,8 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
|
|
||||||
override func updateUI(account: AccountMO) {
|
override func updateUI(account: AccountMO) {
|
||||||
super.updateUI(account: account)
|
super.updateUI(account: account)
|
||||||
profileAccessibilityElement.navigationDelegate = delegate
|
|
||||||
profileAccessibilityElement.accountID = account.id
|
profileAccessibilityElement.accessibilityLabel = account.displayNameWithoutCustomEmoji
|
||||||
}
|
}
|
||||||
|
|
||||||
override func updateUIForPreferences(account: AccountMO, status: StatusMO) {
|
override func updateUIForPreferences(account: AccountMO, status: StatusMO) {
|
||||||
|
@ -130,27 +130,6 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ConversationMainStatusProfileAccessibilityElement: UIAccessibilityElement {
|
|
||||||
var navigationDelegate: TuskerNavigationDelegate!
|
|
||||||
var mastodonController: MastodonController { navigationDelegate.apiController }
|
|
||||||
var accountID: String!
|
|
||||||
|
|
||||||
override var accessibilityLabel: String? {
|
|
||||||
get { mastodonController.persistentContainer.account(for: accountID)?.displayNameWithoutCustomEmoji }
|
|
||||||
set {}
|
|
||||||
}
|
|
||||||
|
|
||||||
override var accessibilityHint: String? {
|
|
||||||
get { "Double tap to show profile." }
|
|
||||||
set {}
|
|
||||||
}
|
|
||||||
|
|
||||||
override func accessibilityActivate() -> Bool {
|
|
||||||
navigationDelegate.selected(account: accountID)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extension ConversationMainStatusTableViewCell: UIContextMenuInteractionDelegate {
|
extension ConversationMainStatusTableViewCell: UIContextMenuInteractionDelegate {
|
||||||
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
|
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
|
||||||
return UIContextMenuConfiguration(identifier: nil) {
|
return UIContextMenuConfiguration(identifier: nil) {
|
||||||
|
|
|
@ -429,16 +429,10 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
||||||
|
|
||||||
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
||||||
get {
|
get {
|
||||||
guard let text = contentTextView.attributedText,
|
guard let text = contentTextView.attributedText else {
|
||||||
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var actions = [
|
var actions: [UIAccessibilityCustomAction] = []
|
||||||
UIAccessibilityCustomAction(name: "Show \(status.account.displayNameWithoutCustomEmoji)", actionHandler: { [unowned self] _ in
|
|
||||||
self.delegate?.selected(account: status.account.id)
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
]
|
|
||||||
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
||||||
guard let value = value as? URL else {
|
guard let value = value as? URL else {
|
||||||
return
|
return
|
||||||
|
|
|
@ -310,16 +310,10 @@ class TimelineStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
|
|
||||||
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
||||||
get {
|
get {
|
||||||
guard let text = contentTextView.attributedText,
|
guard let text = contentTextView.attributedText else {
|
||||||
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var actions = [
|
var actions: [UIAccessibilityCustomAction] = []
|
||||||
UIAccessibilityCustomAction(name: "Show \(status.account.displayNameWithoutCustomEmoji)", actionHandler: { [unowned self] _ in
|
|
||||||
self.delegate?.selected(account: status.account.id)
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
]
|
|
||||||
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
||||||
guard let value = value as? URL else {
|
guard let value = value as? URL else {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue