Compare commits

..

No commits in common. "40a742139b21c72d5c161256921801262c1878c0" and "2a8e970738937ed3f470a5e0bc851e87b636e150" have entirely different histories.

2 changed files with 7 additions and 25 deletions

View File

@ -87,10 +87,6 @@ class BaseStatusTableViewCell: UITableViewCell {
accessibilityElements = [displayNameLabel!, contentWarningLabel!, collapseButton!, contentTextView!, attachmentsView!]
attachmentsView.isAccessibilityElement = true
if #available(iOS 14.0, *) {
moreButton.showsMenuAsPrimaryAction = true
}
NotificationCenter.default.addObserver(self, selector: #selector(preferencesChanged), name: .preferencesChanged, object: nil)
}
@ -182,6 +178,11 @@ class BaseStatusTableViewCell: UITableViewCell {
collapsible = state.collapsible!
setCollapsed(state.collapsed!, animated: false)
}
if #available(iOS 14.0, *) {
moreButton.showsMenuAsPrimaryAction = true
moreButton.menu = UIMenu(title: "", image: nil, identifier: nil, options: [], children: actionsForStatus(statusID: statusID, sourceView: moreButton))
}
}
func updateStatusState(status: StatusMO) {
@ -198,11 +199,6 @@ class BaseStatusTableViewCell: UITableViewCell {
} else {
reblogButton.accessibilityLabel = NSLocalizedString("Reblog", comment: "reblog button accessibility label")
}
if #available(iOS 14.0, *) {
// keep menu in sync with changed states e.g. bookmarked, muted
moreButton.menu = UIMenu(title: "", image: nil, identifier: nil, options: [], children: actionsForStatus(statusID: statusID, sourceView: moreButton))
}
}
func updateUI(account: AccountMO) {

View File

@ -257,25 +257,11 @@ extension TimelineStatusTableViewCell: TableViewSwipeActionProvider {
}
reply.image = UIImage(systemName: "arrowshape.turn.up.left.fill")
reply.backgroundColor = tintColor
let moreTitle: String
let moreImage: UIImage
// on iOS 14+, more actions are in the context menu so display this as 'Share'
if #available(iOS 14.0, *) {
moreTitle = "Share"
// Bold to more closely match the other action symbols
let config = UIImage.SymbolConfiguration(weight: .bold)
moreImage = UIImage(systemName: "square.and.arrow.up")!.applyingSymbolConfiguration(config)!
} else {
moreTitle = "More"
moreImage = UIImage(systemName: "ellipsis.circle.fill")!
}
let more = UIContextualAction(style: .normal, title: moreTitle) { (action, view, completion) in
let more = UIContextualAction(style: .normal, title: "More") { (action, view, completion) in
completion(true)
self.delegate?.showMoreOptions(forStatus: self.statusID, sourceView: self)
}
more.image = moreImage
more.image = UIImage(systemName: "ellipsis.circle.fill")
more.backgroundColor = .lightGray
return UISwipeActionsConfiguration(actions: [reply, more])
}