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 import SwiftUI
struct HomeScreenRoomCell: View { struct HomeScreenRoomCell: View {
@Environment(\.dynamicTypeSize) var dynamicTypeSize
@Environment(\.redactionReasons) private var redactionReasons @Environment(\.redactionReasons) private var redactionReasons
let room: HomeScreenRoom let room: HomeScreenRoom
@@ -52,13 +53,16 @@ struct HomeScreenRoomCell: View {
@ViewBuilder @ViewBuilder
var avatar: some View { var avatar: some View {
if dynamicTypeSize < .accessibility3 {
LoadableAvatarImage(url: room.avatarURL, LoadableAvatarImage(url: room.avatarURL,
name: room.name, name: room.name,
contentID: room.roomId, contentID: room.roomId,
avatarSize: .room(on: .home), avatarSize: .room(on: .home),
imageProvider: context.imageProvider) imageProvider: context.imageProvider)
.dynamicTypeSize(dynamicTypeSize < .accessibility1 ? dynamicTypeSize : .accessibility1)
.accessibilityHidden(true) .accessibilityHidden(true)
} }
}
var content: some View { var content: some View {
VStack(alignment: .leading, spacing: 2) { VStack(alignment: .leading, spacing: 2) {
+1
View File
@@ -0,0 +1 @@
Hide the avatars when the users has larger font on by Sem Pruijs