From 012917f938f9b25f98be8567d4026732a540cee5 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 27 Aug 2020 15:25:52 -0700 Subject: [PATCH] Improves My Apps tab accessibility --- .../My Apps/InstalledAppsCollectionHeaderView.swift | 1 + AltStore/My Apps/MyAppsViewController.swift | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift b/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift index 4246d023..b3564e9e 100644 --- a/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift +++ b/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift @@ -18,6 +18,7 @@ class InstalledAppsCollectionHeaderView: UICollectionReusableView self.textLabel = UILabel() self.textLabel.translatesAutoresizingMaskIntoConstraints = false self.textLabel.font = UIFont.systemFont(ofSize: 24, weight: .bold) + self.textLabel.accessibilityTraits.insert(.header) self.button = UIButton(type: .system) self.button.translatesAutoresizingMaskIntoConstraints = false diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 8575f160..1b3e76de 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -1367,7 +1367,18 @@ extension MyAppsViewController headerView.button.addTarget(self, action: #selector(MyAppsViewController.refreshAllApps(_:)), for: .primaryActionTriggered) headerView.button.layoutIfNeeded() - headerView.button.isIndicatingActivity = self.isRefreshingAllApps + + if self.isRefreshingAllApps + { + headerView.button.isIndicatingActivity = true + headerView.button.accessibilityLabel = NSLocalizedString("Refreshing", comment: "") + headerView.button.accessibilityTraits.remove(.notEnabled) + } + else + { + headerView.button.isIndicatingActivity = false + headerView.button.accessibilityLabel = nil + } } return headerView