1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-16 18:58:45 +01:00

Re-enable A11y (IOS-194)

This commit is contained in:
Nathan Mattes 2023-11-20 13:00:37 +01:00
parent 32520be6c9
commit 873c5befe2
2 changed files with 66 additions and 70 deletions

View File

@ -54,7 +54,7 @@ extension ProfileCardView.ViewModel {
bindRelationship(view: view) bindRelationship(view: view)
bindDashboard(view: view) bindDashboard(view: view)
bindFamiliarFollowers(view: view) bindFamiliarFollowers(view: view)
// bindAccessibility(view: view) bindAccessibility(view: view)
} }
private func bindHeader(view: ProfileCardView) { private func bindHeader(view: ProfileCardView) {
@ -177,73 +177,69 @@ extension ProfileCardView.ViewModel {
view.familiarFollowersDashboardView.configure(familiarFollowers: familiarFollowers) view.familiarFollowersDashboardView.configure(familiarFollowers: familiarFollowers)
} }
.store(in: &disposeBag) .store(in: &disposeBag)
// $backgroundColor
// .assign(to: \.backgroundColor, on: view.familiarFollowersDashboardView.viewModel)
// .store(in: &disposeBag)
} }
private func bindAccessibility(view: ProfileCardView) {
// private func bindAccessibility(view: ProfileCardView) { let authorAccessibilityLabel = Publishers.CombineLatest(
// let authorAccessibilityLabel = Publishers.CombineLatest( $authorName,
// $authorName, $bioContent
// $bioContent )
// ) .map { authorName, bioContent -> String? in
// .map { authorName, bioContent -> String? in var strings: [String?] = []
// var strings: [String?] = [] strings.append(authorName?.string)
// strings.append(authorName?.string) strings.append(bioContent?.string)
// strings.append(bioContent?.string) return strings.compactMap { $0 }.joined(separator: ", ")
// return strings.compactMap { $0 }.joined(separator: ", ") }
// }
// authorAccessibilityLabel
// authorAccessibilityLabel .map { $0 ?? "" }
// .map { $0 ?? "" } .assign(to: &$groupedAccessibilityLabel)
// .assign(to: &$groupedAccessibilityLabel)
// $groupedAccessibilityLabel
// $groupedAccessibilityLabel .sink { accessibilityLabel in
// .sink { accessibilityLabel in view.accessibilityLabel = accessibilityLabel
// view.accessibilityLabel = accessibilityLabel }
// } .store(in: &disposeBag)
// .store(in: &disposeBag)
// let statusesContent = $statusesCount
// let statusesContent = $statusesCount .removeDuplicates()
// .removeDuplicates() .map {
// .map { AXCustomContent(
// AXCustomContent( label: L10n.Scene.Profile.Dashboard.otherPosts,
// label: L10n.Scene.Profile.Dashboard.otherPosts, value: String(describing: $0)
// value: "\($0.)" )
// ) }
// } let followingContent = $followingCount
// let followingContent = $followingCount .removeDuplicates()
// .removeDuplicates() .map {
// .map { AXCustomContent(
// AXCustomContent( label: L10n.Scene.Profile.Dashboard.otherFollowing,
// label: L10n.Scene.Profile.Dashboard.otherFollowing, value: String(describing: $0)
// value: $0 )
// ) }
// } let followersContent = $followersCount
// let followersContent = $followersCount .removeDuplicates()
// .removeDuplicates() .map {
// .map { AXCustomContent(
// AXCustomContent( label: L10n.Scene.Profile.Dashboard.otherFollowers,
// label: L10n.Scene.Profile.Dashboard.otherFollowers, value: String(describing: $0)
// value: $0 )
// ) }
// } let familiarContent = view.familiarFollowersDashboardView.viewModel.$label
// let familiarContent = view.familiarFollowersDashboardView.viewModel.$label .map { $0?.accessibilityLabel ?? ""}
// .map { $0?.accessibilityLabel } .removeDuplicates()
// .removeDuplicates() .map {
// .map { AXCustomContent(
// AXCustomContent( label: L10n.Scene.Profile.Dashboard.familiarFollowers,
// label: L10n.Scene.Profile.Dashboard.familiarFollowers, value: $0
// value: $0 )
// ) }
// } Publishers.CombineLatest4(
// Publishers.CombineLatest4( statusesContent,
// statusesContent, followingContent,
// followingContent, followersContent,
// followersContent, familiarContent
// familiarContent ).sink { statuses, following, followers, familiar in
// ).sink { statuses, following, followers, familiar in view.accessibilityCustomContent = [statuses, following, followers, familiar].compactMap { $0 }
// view.accessibilityCustomContent = [statuses, following, followers, familiar].compactMap { $0 } }.store(in: &disposeBag)
// }.store(in: &disposeBag) }
// }
} }

View File

@ -22,7 +22,7 @@ extension FamiliarFollowersDashboardView {
@Published var emojis: MastodonContent.Emojis = [:] @Published var emojis: MastodonContent.Emojis = [:]
@Published var backgroundColor: UIColor? @Published var backgroundColor: UIColor?
@Published var label: MetaContent? @Published public var label: MetaContent?
} }
} }