diff --git a/ownCloud/Bookmarks/BookmarkViewController.swift b/ownCloud/Bookmarks/BookmarkViewController.swift index 26497f3f2..e2a7e02c5 100644 --- a/ownCloud/Bookmarks/BookmarkViewController.swift +++ b/ownCloud/Bookmarks/BookmarkViewController.swift @@ -74,7 +74,7 @@ class BookmarkViewController: StaticTableViewController { if let textField = sender as? UITextField { self?.bookmark?.name = (textField.text?.count == 0) ? nil : textField.text } - }, placeholder: "Name".localized, identifier: "row-name-name") + }, placeholder: "Name".localized, identifier: "row-name-name", accessibilityLabel: "Server name".localized) nameSection = StaticTableViewSection(headerTitle: "Name".localized, footerTitle: nil, identifier: "section-name", rows: [ nameRow! ]) @@ -116,7 +116,7 @@ class BookmarkViewController: StaticTableViewController { self?.nameRow?.textField?.attributedPlaceholder = NSAttributedString(string: placeholderString, attributes: [.foregroundColor : Theme.shared.activeCollection.tableRowColors.secondaryLabelColor]) } - }, placeholder: "https://", keyboardType: .URL, autocorrectionType: .no, identifier: "row-url-url") + }, placeholder: "https://", keyboardType: .URL, autocorrectionType: .no, identifier: "row-url-url", accessibilityLabel: "Sever url".localized) certificateRow = StaticTableViewRow(rowWithAction: { [weak self] (_, _) in if let certificate = self?.bookmark?.certificate { @@ -136,14 +136,14 @@ class BookmarkViewController: StaticTableViewController { self?.bookmark?.authenticationData = nil self?.composeSectionsAndRows(animated: true) } - }, placeholder: "Username".localized, autocorrectionType: .no, identifier: "row-credentials-username") + }, placeholder: "Username".localized, autocorrectionType: .no, identifier: "row-credentials-username", accessibilityLabel: "Server Username".localized) passwordRow = StaticTableViewRow(secureTextFieldWithAction: { [weak self] (_, sender) in if (sender as? UITextField) != nil, self?.bookmark?.authenticationData != nil { self?.bookmark?.authenticationData = nil self?.composeSectionsAndRows(animated: true) } - }, placeholder: "Password".localized, autocorrectionType: .no, identifier: "row-credentials-password") + }, placeholder: "Password".localized, autocorrectionType: .no, identifier: "row-credentials-password", accessibilityLabel: "Server Password".localized) addPasswordManagerButton() diff --git a/ownCloud/Client/Actions/NamingViewController.swift b/ownCloud/Client/Actions/NamingViewController.swift index 2b963c6ec..386c6f735 100644 --- a/ownCloud/Client/Actions/NamingViewController.swift +++ b/ownCloud/Client/Actions/NamingViewController.swift @@ -174,6 +174,7 @@ class NamingViewController: UIViewController { nameTextField.addTarget(self, action: #selector(textfieldDidChange(_:)), for: .editingChanged) nameTextField.enablesReturnKeyAutomatically = true nameTextField.autocorrectionType = .no + nameTextField.accessibilityLabel = "Folder name".localized // Name container view nameContainer.translatesAutoresizingMaskIntoConstraints = false diff --git a/ownCloud/Client/ClientItemCell.swift b/ownCloud/Client/ClientItemCell.swift index 91dc9b1ff..c7292415f 100644 --- a/ownCloud/Client/ClientItemCell.swift +++ b/ownCloud/Client/ClientItemCell.swift @@ -168,6 +168,7 @@ class ClientItemCell: ThemeTableViewCell { self.iconView.alpha = item.isPlaceholder ? 0.5 : 1.0 self.moreButton.isHidden = item.isPlaceholder ? true : false + self.moreButton.accessibilityLabel = item.name! + " " + "Actions".localized } // MARK: - Themeing diff --git a/ownCloud/Client/ClientQueryViewController.swift b/ownCloud/Client/ClientQueryViewController.swift index 40250ccf1..c7b5c1d16 100644 --- a/ownCloud/Client/ClientQueryViewController.swift +++ b/ownCloud/Client/ClientQueryViewController.swift @@ -147,6 +147,9 @@ class ClientQueryViewController: UITableViewController, Themeable { self.tableView.dragInteractionEnabled = true let actionsBarButton: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(uploadsBarButtonPressed)) + actionsBarButton.accessibilityLabel = "Upload files".localized + actionsBarButton.setTitleTextAttributes([.font :UIFont.systemFont(ofSize: 10)], for: .normal) + actionsBarButton.setTitleTextAttributes([.font :UIFont.systemFont(ofSize: 10)], for: .highlighted) self.navigationItem.rightBarButtonItem = actionsBarButton } diff --git a/ownCloud/Client/SortBar.swift b/ownCloud/Client/SortBar.swift index 3cb118534..7c9d9fc33 100644 --- a/ownCloud/Client/SortBar.swift +++ b/ownCloud/Client/SortBar.swift @@ -50,6 +50,7 @@ class SortBar: UIView, Themeable { let title = NSString(format: "Sorted by %@ ▼".localized as NSString, sortMethod.localizedName()) as String sortButton.setTitle(title, for: .normal) + sortButton.accessibilityLabel = NSString(format: "Sorted by %@".localized as NSString, sortMethod.localizedName()) as String sortSegmentedControl.selectedSegmentIndex = SortMethod.all.index(of: sortMethod)! @@ -73,6 +74,7 @@ class SortBar: UIView, Themeable { sortButton.accessibilityIdentifier = "sort-bar.sortButton" leftButtonImage = Theme.shared.image(for: "folder-create", size: CGSize(width: 30.0, height: 30.0))!.withRenderingMode(.alwaysTemplate) + leftButton.accessibilityLabel = "Create Folder".localized rightButtonImage = Theme.shared.image(for: "folder-create", size: CGSize(width: 30.0, height: 30.0))!.withRenderingMode(.alwaysTemplate) diff --git a/ownCloud/Resources/en.lproj/Localizable.strings b/ownCloud/Resources/en.lproj/Localizable.strings index 002c34915..10819405c 100644 --- a/ownCloud/Resources/en.lproj/Localizable.strings +++ b/ownCloud/Resources/en.lproj/Localizable.strings @@ -43,6 +43,10 @@ "Missing hostname" = "Missing hostname"; "The entered URL does not include a hostname." = "The entered URL does not include a hostname."; +"Add server" = "Add server"; +"Sever name" = "Sever name"; +"Server Password" = "Server Password"; +"Server Username" = "Server Username"; /* Client */ "Browse" = "Browse"; @@ -60,6 +64,7 @@ "Everything up-to-date." = "Everything up-to-date."; "Please wait…" = "Please wait…"; "Sorted by %@ ▼" = "Sorted by %@ ▼"; +"Sorted by %@" = "Sorted by %@"; "Sort by" = "Sort by"; "name (A-Z)" = "name (A-Z)"; @@ -86,6 +91,7 @@ "This permission is needed to upload photos and videos from your photo library." = "This permission is needed to upload photos and videos from your photo library."; "Not now" = "Not now"; "Upload file" = "Upload file"; +"Upload files" = "Upload files"; /* Server List*/ "Cancel" = "Cancel"; @@ -189,6 +195,7 @@ "Forbidden Characters" = "Forbidden Characters"; "File name cannot contain / or \\" = "File name cannot contain / or \\"; "New Folder" = "New Folder"; +"Folder name" = "Folder name"; "Rename" =" Rename"; "Create folder" =" Create folder"; "Duplicate" = "Duplicate"; @@ -198,6 +205,7 @@ "Copy here" = "Copy here"; "Cannot connect to " = "Cannot connect to "; " couldn't download this file" = " couldn't download this file"; +"Actions" = "Actions"; /* Directory Picker Messages */ "Move here" = "Move here"; diff --git a/ownCloud/Server List/ServerListBookmarkCell.swift b/ownCloud/Server List/ServerListBookmarkCell.swift index cd8bc4807..06b892048 100644 --- a/ownCloud/Server List/ServerListBookmarkCell.swift +++ b/ownCloud/Server List/ServerListBookmarkCell.swift @@ -40,8 +40,11 @@ class ServerListBookmarkCell : ThemeTableViewCell { iconView.translatesAutoresizingMaskIntoConstraints = false iconView.contentMode = .scaleAspectFit - titleLabel.font = UIFont.systemFont(ofSize: 17, weight: UIFont.Weight.semibold) - detailLabel.font = UIFont.systemFont(ofSize: 14) + titleLabel.font = UIFont.preferredFont(forTextStyle: .body) + titleLabel.adjustsFontForContentSizeCategory = true + + detailLabel.font = UIFont.preferredFont(forTextStyle: .subheadline) + detailLabel.adjustsFontForContentSizeCategory = true detailLabel.textColor = UIColor.gray diff --git a/ownCloud/Server List/ServerListTableViewController.swift b/ownCloud/Server List/ServerListTableViewController.swift index 95225c59e..7b1fdbe21 100644 --- a/ownCloud/Server List/ServerListTableViewController.swift +++ b/ownCloud/Server List/ServerListTableViewController.swift @@ -72,7 +72,9 @@ class ServerListTableViewController: UITableViewController, Themeable { self.tableView.estimatedRowHeight = 80 self.tableView.allowsSelectionDuringEditing = true - self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.add, target: self, action: #selector(addBookmark)) + let addServerBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.add, target: self, action: #selector(addBookmark)) + addServerBarButtonItem.accessibilityLabel = "Add Server".localized + self.navigationItem.rightBarButtonItem = addServerBarButtonItem welcomeOverlayView.translatesAutoresizingMaskIntoConstraints = false diff --git a/ownCloud/UI Elements/StaticTableViewRow.swift b/ownCloud/UI Elements/StaticTableViewRow.swift index 0f298d6ae..a91bcae22 100644 --- a/ownCloud/UI Elements/StaticTableViewRow.swift +++ b/ownCloud/UI Elements/StaticTableViewRow.swift @@ -151,7 +151,7 @@ class StaticTableViewRow : NSObject, UITextFieldDelegate { // MARK: - Text Field public var textField : UITextField? - convenience init(textFieldWithAction action: StaticTableViewRowAction?, placeholder placeholderString: String = "", value textValue: String = "", secureTextEntry : Bool = false, keyboardType: UIKeyboardType = UIKeyboardType.default, autocorrectionType: UITextAutocorrectionType = UITextAutocorrectionType.default, autocapitalizationType: UITextAutocapitalizationType = UITextAutocapitalizationType.none, enablesReturnKeyAutomatically: Bool = true, returnKeyType : UIReturnKeyType = UIReturnKeyType.default, identifier : String? = nil) { + convenience init(textFieldWithAction action: StaticTableViewRowAction?, placeholder placeholderString: String = "", value textValue: String = "", secureTextEntry : Bool = false, keyboardType: UIKeyboardType = UIKeyboardType.default, autocorrectionType: UITextAutocorrectionType = UITextAutocorrectionType.default, autocapitalizationType: UITextAutocapitalizationType = UITextAutocapitalizationType.none, enablesReturnKeyAutomatically: Bool = true, returnKeyType : UIReturnKeyType = UIReturnKeyType.default, identifier : String? = nil, accessibilityLabel: String? = nil) { self.init() @@ -203,9 +203,11 @@ class StaticTableViewRow : NSObject, UITextFieldDelegate { cellTextField.textColor = (self?.enabled == true) ? themeCollection.tableRowColors.labelColor : themeCollection.tableRowColors.secondaryLabelColor cellTextField.attributedPlaceholder = NSAttributedString(string: placeholderString, attributes: [.foregroundColor : themeCollection.tableRowColors.secondaryLabelColor]) }) + + cellTextField.accessibilityLabel = accessibilityLabel } - convenience init(secureTextFieldWithAction action: StaticTableViewRowAction?, placeholder placeholderString: String = "", value textValue: String = "", keyboardType: UIKeyboardType = UIKeyboardType.default, autocorrectionType: UITextAutocorrectionType = UITextAutocorrectionType.default, autocapitalizationType: UITextAutocapitalizationType = UITextAutocapitalizationType.none, enablesReturnKeyAutomatically: Bool = true, returnKeyType : UIReturnKeyType = UIReturnKeyType.default, identifier : String? = nil) { + convenience init(secureTextFieldWithAction action: StaticTableViewRowAction?, placeholder placeholderString: String = "", value textValue: String = "", keyboardType: UIKeyboardType = UIKeyboardType.default, autocorrectionType: UITextAutocorrectionType = UITextAutocorrectionType.default, autocapitalizationType: UITextAutocapitalizationType = UITextAutocapitalizationType.none, enablesReturnKeyAutomatically: Bool = true, returnKeyType : UIReturnKeyType = UIReturnKeyType.default, identifier : String? = nil, accessibilityLabel: String? = nil) { self.init(textFieldWithAction: action, placeholder: placeholderString, value: textValue, secureTextEntry: true, @@ -213,7 +215,8 @@ class StaticTableViewRow : NSObject, UITextFieldDelegate { autocorrectionType: autocorrectionType, autocapitalizationType: autocapitalizationType, enablesReturnKeyAutomatically: enablesReturnKeyAutomatically, - returnKeyType: returnKeyType, identifier : identifier) + returnKeyType: returnKeyType, identifier : identifier, + accessibilityLabel: accessibilityLabel) } @objc func textFieldContentChanged(_ sender: UITextField) { diff --git a/ownCloud/Viewer/DisplayViewController.swift b/ownCloud/Viewer/DisplayViewController.swift index 74e32f8fd..99aa1446a 100644 --- a/ownCloud/Viewer/DisplayViewController.swift +++ b/ownCloud/Viewer/DisplayViewController.swift @@ -213,7 +213,9 @@ class DisplayViewController: UIViewController { } parent.navigationItem.title = item.name - parent.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "•••", style: .plain, target: self, action: #selector(optionsBarButtonPressed)) + let actionsBarButtonItem = UIBarButtonItem(title: "•••", style: .plain, target: self, action: #selector(optionsBarButtonPressed)) + actionsBarButtonItem.accessibilityLabel = item.name + " " + "Actions".localized + parent.navigationItem.rightBarButtonItem = actionsBarButtonItem } // MARK: - Download actions