Room list avatar accessibility. (#707)

* Hide the avatar when the Dynamic Text is large

---------

Co-authored-by: sempruijs <sem@pruijs.net>
This commit is contained in:
Doug
2023-03-20 10:29:49 +00:00
committed by GitHub
parent 4a7a861a4c
commit bbd64092e7
2 changed files with 11 additions and 6 deletions
@@ -17,6 +17,7 @@
import SwiftUI
struct HomeScreenRoomCell: View {
@Environment(\.dynamicTypeSize) var dynamicTypeSize
@Environment(\.redactionReasons) private var redactionReasons
let room: HomeScreenRoom
@@ -52,12 +53,15 @@ struct HomeScreenRoomCell: View {
@ViewBuilder
var avatar: some View {
LoadableAvatarImage(url: room.avatarURL,
name: room.name,
contentID: room.roomId,
avatarSize: .room(on: .home),
imageProvider: context.imageProvider)
.accessibilityHidden(true)
if dynamicTypeSize < .accessibility3 {
LoadableAvatarImage(url: room.avatarURL,
name: room.name,
contentID: room.roomId,
avatarSize: .room(on: .home),
imageProvider: context.imageProvider)
.dynamicTypeSize(dynamicTypeSize < .accessibility1 ? dynamicTypeSize : .accessibility1)
.accessibilityHidden(true)
}
}
var content: some View {