forked from shadowfacts/Tusker
Better accessibility label for conversation toggle collapse button
This commit is contained in:
parent
1f37a5e7eb
commit
4b2a263889
|
@ -125,7 +125,7 @@ class ConversationTableViewController: EnhancedTableViewController {
|
||||||
})
|
})
|
||||||
|
|
||||||
visibilityBarButtonItem = UIBarButtonItem(image: ConversationTableViewController.showPostsImage, style: .plain, target: self, action: #selector(toggleVisibilityButtonPressed))
|
visibilityBarButtonItem = UIBarButtonItem(image: ConversationTableViewController.showPostsImage, style: .plain, target: self, action: #selector(toggleVisibilityButtonPressed))
|
||||||
visibilityBarButtonItem.isSelected = showStatusesAutomatically
|
updateVisibilityBarButtonItem()
|
||||||
navigationItem.rightBarButtonItem = visibilityBarButtonItem
|
navigationItem.rightBarButtonItem = visibilityBarButtonItem
|
||||||
// disable transparent background when scroll to top because it looks weird when items earlier in the thread load in
|
// disable transparent background when scroll to top because it looks weird when items earlier in the thread load in
|
||||||
// (it remains transparent slightly too long, resulting in a flash of the content under the transparent bar)
|
// (it remains transparent slightly too long, resulting in a flash of the content under the transparent bar)
|
||||||
|
@ -138,6 +138,11 @@ class ConversationTableViewController: EnhancedTableViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateVisibilityBarButtonItem() {
|
||||||
|
visibilityBarButtonItem.isSelected = showStatusesAutomatically
|
||||||
|
visibilityBarButtonItem.accessibilityLabel = showStatusesAutomatically ? "Collapse All" : "Expand All"
|
||||||
|
}
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
private func loadMainStatus() async {
|
private func loadMainStatus() async {
|
||||||
guard loadingState == .unloaded else { return }
|
guard loadingState == .unloaded else { return }
|
||||||
|
@ -391,7 +396,7 @@ class ConversationTableViewController: EnhancedTableViewController {
|
||||||
tableView.beginUpdates()
|
tableView.beginUpdates()
|
||||||
tableView.endUpdates()
|
tableView.endUpdates()
|
||||||
|
|
||||||
visibilityBarButtonItem.isSelected = showStatusesAutomatically
|
updateVisibilityBarButtonItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue