Add a11y label for expanded/collapsed status for Master Feed

This commit is contained in:
Rizwan Mohamed Ibrahim 2020-07-14 18:07:29 +05:30
parent 4625805fba
commit 1427e1d8c6
No known key found for this signature in database
GPG Key ID: D5BEE468D448BCC5
1 changed files with 12 additions and 2 deletions

View File

@ -21,13 +21,23 @@ class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView {
get { get {
if unreadCount > 0 { if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity") let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
return "\(name) \(unreadCount) \(unreadLabel)" return "\(name) \(unreadCount) \(unreadLabel) \(expandedStateMessage) "
} else { } else {
return name return "\(name) \(expandedStateMessage) "
} }
} }
} }
private var expandedStateMessage: String {
set {}
get {
if disclosureExpanded {
return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility")
}
return NSLocalizedString("Collapsed", comment: "Disclosure button expanded state for accessibility")
}
}
var unreadCount: Int { var unreadCount: Int {
get { get {
return unreadCountView.unreadCount return unreadCountView.unreadCount