Procházet zdrojové kódy

Accessibility for Plus button and floating menu

Philippe Weidmann před 4 roky
rodič
revize
749f6baee0

+ 1 - 0
iOSClient/AppDelegate.m

@@ -785,6 +785,7 @@
     UIImage *buttonImage = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"tabBarPlus"] width:120 height:120 color:UIColor.whiteColor];
     UIButton *buttonPlus = [UIButton buttonWithType:UIButtonTypeCustom];
     buttonPlus.tag = 99;
+    buttonPlus.accessibilityLabel = NSLocalizedString(@"_accessibility_add_upload_", nil);
     [buttonPlus setImage:buttonImage forState:UIControlStateNormal];
     buttonPlus.backgroundColor = NCBrandColor.sharedInstance.brandElement;
     buttonPlus.layer.cornerRadius = buttonSize / 2;

+ 10 - 3
iOSClient/Main/Menu/NCMainMenuTableViewController.swift

@@ -77,6 +77,13 @@ class NCMainMenuTableViewController: UITableViewController {
         return cell
     }
 
+    // MARK: - Accessibility
+    
+    open override func accessibilityPerformEscape() -> Bool {
+        dismiss(animated: true)
+        return true
+    }
+
 }
 extension NCMainMenuTableViewController: FloatingPanelControllerDelegate {
 
@@ -87,7 +94,7 @@ extension NCMainMenuTableViewController: FloatingPanelControllerDelegate {
     func floatingPanel(_ vc: FloatingPanelController, behaviorFor newCollection: UITraitCollection) -> FloatingPanelBehavior? {
         return NCMainMenuFloatingPanelBehavior()
     }
-    
+
     func floatingPanelDidEndDecelerating(_ vc: FloatingPanelController) {
         if vc.position == .hidden {
             vc.dismiss(animated: false, completion: nil)
@@ -98,7 +105,7 @@ extension NCMainMenuTableViewController: FloatingPanelControllerDelegate {
 class NCMainMenuFloatingPanelLayout: FloatingPanelLayout {
 
     let height: CGFloat
-    
+
     init(height: Int) {
         self.height = CGFloat(height)
     }
@@ -118,7 +125,7 @@ class NCMainMenuFloatingPanelLayout: FloatingPanelLayout {
             return nil
         }
     }
-    
+
     var positionReference: FloatingPanelLayoutReference {
         return .fromSuperview
     }

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -24,6 +24,7 @@
 
 "_cancel_"                  = "Cancel";
 "_upload_file_"             = "Upload file";
+"_accessibility_add_upload_" = "Add and upload";
 "_download_file_"           = "Download file";
 "_loading_"                 = "Loading";
 "_loading_with_points_"     = "Loading…";