Upload
johnny-sung
View
106
Download
4
Embed Size (px)
Citation preview
Young Feng
• Director of braille teaching
at Taiwan Foundation for the Blind.
• The committee of NCC.
• Trainer of web accessibility testing.
https://fb.com/j796160836
Johnny SungMobile devices Developer
https://plus.google.com/+JohnnySung
http://about.me/j796160836
Agenda
• I'm a mobile developer
• A few things you need to do
• The tips for making an
accessible app
Accessibility for iOS
• Setting the descriptions
NSString *accessibilityLabel;
NSString *accessibilityHint;
UIAccessibilityTraits accessibilityTraits;
What The System reads
Favorites,button,double tap to open
accessibilityLabel accessibilityHint
accessibilityTraits
• plain text
• Button with background
• A empty button
Notices the button that you make
“btn.png”,button
Button
Detect VoiceOver Status
• Register the notificationsUIAccessibilityVoiceOverStatusChanged
• Determine VoiceOver statusUIAccessibilityIsVoiceOverRunning()
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(voiceOverStatusChanged:)
name:UIAccessibilityVoiceOverStatusChanged
object:nil];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:UIAccessibilityVoiceOverStatusChanged
object:nil];
Register Notifications
Remove Notifications
Detect VoiceOver Status
-(void)voiceOverStatusChanged:(NSNotification *)n {
if (UIAccessibilityIsVoiceOverRunning()) {
// Voice over is running
} else {
// Voice over is not running
}
}
Determine whether VoiceOver is on or off
Detect VoiceOver Status
• Move focus toUIAccessibilityLayoutChangedNotification
• Update whole screens (Sound included)UIAccessibilityScreenChangedNotification
Moving the focus
http://www.deque.com/blog/dynamic-notifications/
Moving the focus
UIAccessibilityPostNotification(
UIAccessibilityLayoutChangedNotification, view02);
Move focus to specify element
Update whole screens
UIAccessibilityPostNotification(
UIAccessibilityScreenChangedNotification, view01);
UIAccessibilityPostNotification(
UIAccessibilityScreenChangedNotification, nil);
Update whole screens and Move focus to specify element
(focus on first top-left element)
Announcement messages
UIAccessibilityPostNotification(
UIAccessibilityAnnouncementNotification, @"hello");
-(BOOL) accessibilityPerformMagicTap {
// Do something
}
• Implement the MagicTap actions
MagicTap (Two finger double tap)
Declare the rotor actions
UIAccessibilityCustomAction *a1 =
[[UIAccessibilityCustomAction alloc]
initWithName:@"Action 1"
target:self
selector:@selector(action01:)];
UIAccessibilityCustomAction *a2 =
[[UIAccessibilityCustomAction alloc]
initWithName:@"Action 2"
target:self
selector:@selector(action02:)];
self.myButton.accessibilityCustomActions
= @[a1, a2];
Declare the rotor actions
- (BOOL) action01:(UIAccessibilityCustomAction *)action {
// Do something
return YES;
}
- (BOOL) action02:(UIAccessibilityCustomAction *)action {
// Do something
return YES;
}
Contrast ratio with text and background
• 4.5 : 1 WCAG 2.0 AA
compliance
• 7 : 1 WCAG 2.0 AAA compliance
http://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast
Web Content Accessibility Guidelines (WCAG) 2.0
Contrast checker
http://snook.ca/technical/colour_contrast/colour.html
Button size
•48 x 48 px (Google)
•44 x 44 px (Apple)
https://www.google.com/design/spec/usability/accessibility.html#accessibility-types
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LayoutandAppearance.html
References
• https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIA
ccessibility_Protocol/
• http://www.deque.com/blog/dynamic-notifications/
• https://eyes-
free.googlecode.com/svn/trunk/documentation/android_access/index.html
• https://www.udemy.com/accessibility-features-on-android/
• http://blog.supertop.co/post/117642258462/custom-accessibility-options-in-
unread
• http://www.programcreek.com/java-api-
examples/index.php?api=android.view.accessibility.AccessibilityManager