Commit 3c57a2c8 authored by Zach Knox's avatar Zach Knox
Browse files

Add VoiceOver accessibility support to CollectionViewCells (Closes #15)

Also started working on making the launch screen actually look right
parent 4efc05c2
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="49O-ie-MPO">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="49O-ie-MPO">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
......@@ -21,11 +21,16 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" ambiguous="YES" barStyle="black" translatesAutoresizingMaskIntoConstraints="NO" id="dLQ-LD-ZYN">
<toolbar clearsContextBeforeDrawing="NO" contentMode="scaleToFill" ambiguous="YES" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dLQ-LD-ZYN">
<rect key="frame" x="0.0" y="623" width="375" height="44"/>
<color key="backgroundColor" red="0.0" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<items>
<barButtonItem title="Item" id="UZb-P7-xWV"/>
<barButtonItem image="Gear" style="plain" id="UZb-P7-xWV"/>
<barButtonItem style="plain" systemItem="flexibleSpace" id="Cjx-w1-vgo"/>
<barButtonItem systemItem="refresh" id="Sxw-4d-pD1"/>
</items>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="barTintColor" red="0.0" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
</toolbar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
......@@ -33,7 +38,18 @@
<constraint firstItem="uEj-Wh-tIe" firstAttribute="top" secondItem="dLQ-LD-ZYN" secondAttribute="bottom" id="vxR-Lb-0T3"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="oR9-Bj-2qk"/>
<navigationItem key="navigationItem" id="oR9-Bj-2qk">
<nil key="title"/>
<segmentedControl key="titleView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" id="JH1-to-6Bm">
<rect key="frame" x="112.5" y="7" width="150" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title=""/>
<segment title=""/>
</segments>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</segmentedControl>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="yPd-Xq-4eE" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
......@@ -44,10 +60,12 @@
<objects>
<navigationController id="49O-ie-MPO" sceneMemberID="viewController">
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="lQp-4M-AdE">
<navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" barStyle="black" id="lQp-4M-AdE">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.039215686270000001" green="0.39607843139999999" blue="0.20784313730000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="tintColor" red="0.0" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="barTintColor" red="0.0" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
</navigationBar>
<connections>
<segue destination="rgX-hK-Yk9" kind="relationship" relationship="rootViewController" id="PjG-Yg-Yf2"/>
......@@ -58,4 +76,7 @@
<point key="canvasLocation" x="-476" y="475"/>
</scene>
</scenes>
<resources>
<image name="Gear" width="25" height="25"/>
</resources>
</document>
......@@ -300,6 +300,7 @@
<outlet property="LocationsListLayout" destination="eqw-AF-DSB" id="kLH-bz-bdn"/>
<outlet property="RightButton" destination="vtX-VZ-RB4" id="iv8-Xb-WoJ"/>
<outlet property="favoritesControl" destination="9BX-Nz-NN6" id="94S-gq-Nni"/>
<outlet property="settingsButton" destination="MHZ-t0-Moj" id="nyC-iO-GTe"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cQW-T4-yZv" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
......@@ -19,6 +19,8 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
}
@IBOutlet var RightButton: UIBarButtonItem!
@IBOutlet var settingsButton: UIBarButtonItem!
@IBOutlet var LocationsList: UICollectionView!
@IBOutlet var LocationsListLayout: UICollectionViewFlowLayout!
......@@ -73,6 +75,9 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
LocationsListLayout.invalidateLayout()
settingsButton.accessibilityLabel = "Settings"
LastUpdatedLabel.accessibilityHint = ""
LocationsListLayout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10)
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
......@@ -89,7 +94,8 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
self.LastUpdatedLabel.title = "Updated: " + self.shortDateFormat(date)
}
}
}
}
func refresh(_ sender: Any) {
refreshControl.beginRefreshing()
......@@ -156,6 +162,10 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
cell.timeDescriptionLabel.text = Utilities.timeUntilFacility(facility)
cell.accessibilityLabel = cell.nameLabel.text! + ", Currently " + cell.openClosedLabel.text! + "." + cell.timeDescriptionLabel.text!
cell.accessibilityHint = "Double Tap to view details"
self.reloadInputViews()
return cell
}
......
......@@ -16,6 +16,9 @@ class SRCTSimpleCollectionViewCell: UICollectionViewCell {
override func awakeFromNib() {
super.awakeFromNib()
isAccessibilityElement = true
shouldGroupAccessibilityChildren = true
self.layer.cornerRadius = 8
// Initialization code
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment