Skip to content
Snippets Groups Projects
Commit e7f57bd5 authored by Alexender White's avatar Alexender White Committed by Kateryna Kostiuk
Browse files

accessibility: welcome + about screens

Change-Id: I46d80a2242f872ca27daff48a76af5fa75c25218
parent 63f25d1b
No related branches found
No related tags found
No related merge requests found
......@@ -47,4 +47,5 @@ struct SmartListAccessibilityIdentifiers {
static let contactPicker = "contactPicker"
static let accountsListTitle = "accountsListTitle"
static let closeAccountsList = "closeAccountsList"
static let closeAboutView = "closeAboutView"
}
......@@ -24,10 +24,25 @@ struct AboutSwiftUIView: View {
let padding: CGFloat = 20
var body: some View {
VStack(spacing: padding) {
ZStack {
HStack {
Spacer() // Push the close button to the right
CloseButton(
action: { [weak dismissHandler] in
dismissHandler?.dismissView()
},
accessibilityIdentifier: SmartListAccessibilityIdentifiers.closeAboutView
)
}
Image("jami_gnupackage")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 30)
.accessibilityLabel(L10n.Accessibility.aboutJamiTitle)
.frame(maxWidth: .infinity, alignment: .center) // This will center the image horizontally
}
ScrollView {
VStack(alignment: .leading, spacing: padding) {
VStack(alignment: .center) {
......@@ -67,6 +82,7 @@ struct AboutSwiftUIView: View {
.cornerRadius(8)
}
}
.padding(.horizontal)
HStack {
Spacer()
Button(action: {
......@@ -82,7 +98,8 @@ struct AboutSwiftUIView: View {
Text(model.feedbackLabel)
})
}
.padding(.horizontal)
}
.padding()
.padding(.vertical)
}
}
......@@ -29,6 +29,8 @@ internal enum L10n {
internal static let noWarranty2 = L10n.tr("Localizable", "aboutJami.noWarranty2", fallback: "version 3 or later for details.")
}
internal enum Accessibility {
/// About Jami
internal static let aboutJamiTitle = L10n.tr("Localizable", "accessibility.aboutJamiTitle", fallback: "About Jami")
/// Close
internal static let close = L10n.tr("Localizable", "accessibility.close", fallback: "Close")
/// Add account
......@@ -39,6 +41,8 @@ internal enum L10n {
}
/// Switch account
internal static let smartListSwitchAccounts = L10n.tr("Localizable", "accessibility.smartListSwitchAccounts", fallback: "Switch account")
/// Welcome to Jami
internal static let welcomeToJamiTitle = L10n.tr("Localizable", "accessibility.welcomeToJamiTitle", fallback: "Welcome to Jami")
}
internal enum Account {
/// Account Status
......
......@@ -243,3 +243,23 @@ extension View {
self.modifier(OptionalListSectionSpacing(spacing: spacing))
}
}
struct CloseButton: View {
let action: () -> Void
let accessibilityIdentifier: String
var body: some View {
Button(action: {
action()
}, label: {
Image(systemName: "xmark")
.font(.system(size: 12, weight: .bold))
.foregroundColor(.black)
.padding(10) // Increases tap area
.background(Circle().fill(Color.gray.opacity(0.4)))
.accessibilityIdentifier(accessibilityIdentifier)
.accessibilityLabel(L10n.Accessibility.close)
.padding()
})
}
}
......@@ -51,18 +51,10 @@ struct AccountLists: View {
HStack {
Spacer() // Pushes the button to the right
Button(action: {
accountSelectedCallback()
}, label: {
Image(systemName: "xmark")
.font(.system(size: 12, weight: .bold))
.foregroundColor(.black)
.padding(10) // Increases tap area
.background(Circle().fill(Color.gray.opacity(0.4)))
.accessibilityIdentifier(SmartListAccessibilityIdentifiers.closeAccountsList)
.accessibilityLabel(L10n.Accessibility.close)
.padding()
})
CloseButton(
action: accountSelectedCallback,
accessibilityIdentifier: SmartListAccessibilityIdentifiers.closeAccountsList
)
}
}
......
......@@ -215,6 +215,8 @@ struct HeaderView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 80)
.accessibilityLabel(L10n.Accessibility.welcomeToJamiTitle)
.accessibilityHidden(true)
Text(L10n.Welcome.title)
.font(.headline)
.multilineTextAlignment(.center)
......@@ -347,6 +349,7 @@ extension View {
.ignoresSafeArea()
.scaledToFill()
.accessibilityIdentifier(AccessibilityIdentifiers.welcomeWindow)
.accessibilityHidden(true)
)
}
}
......@@ -510,3 +510,5 @@
"accessibility.smartListSwitchAccounts" = "Switch account";
"accessibility.smartListConnectedAs" = "Your current account is %@";
"accessibility.smartListAddAccount" = "Add account";
"accessibility.aboutJamiTitle" = "About Jami";
"accessibility.welcomeToJamiTitle" = "Welcome to Jami";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment