Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3110] iOS: Support VoiceOver Accessibility

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-09T01:29:49.000+0000
Affected Version/sRelease 1.6.0, Release 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-20 Core, 2012 Sprint 20
ComponentsiOS
LabelsSupportTeam, accessibility_basic, accessibility_module, core, qe-review, qe-testadded
ReporterStephen Tramer
AssigneeMax Stepanov
Created2011-04-15T03:37:14.000+0000
Updated2013-01-02T18:55:32.000+0000

Description

Exactly what the ticket title says. We don't support (any???) accessibility right now, if additional support for it is necessary. Unlikely to be a candidate for a module.

Comments

  1. Fo 2012-02-11

    It should add support of defining Constants UIAccessibilityTraits UIAccessibilityTraitAllowsDirectInteraction; and UIAccessibilityAnnouncementNotification It is very useful. https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAccessibility_Protocol/Introduction/Introduction.html
  2. Rick Blalock 2012-07-09

    @Steve - Curious at WWDC if they said anything about alternate layouts based on accessibility settings.
  3. Max Stepanov 2012-09-18

    Test app.js
       var tabGroup = Ti.UI.createTabGroup({orientationModes: [Ti.UI.PORTRAIT]}),
       winViews = Ti.UI.createWindow({
           title: "View Properties",
           layout: "vertical",
           backgroundColor: "#fff"
       }),
       winTable = Ti.UI.createWindow({
           title: "Table",
           layout: "vertical",
           backgroundColor: "#fff"
       }),
       winEvents = Ti.UI.createWindow({
           title: "Events",
           layout: "vertical",
           backgroundColor: "#fff"
       }),
       tabViews = Ti.UI.createTab({
           window: winViews,
           title: winViews.title
       }),
       tabTable = Ti.UI.createTab({
           window: winTable,
           title: winTable.title
       }),
       tabEvents = Ti.UI.createTab({
           window: winEvents,
           title: winEvents.title
       }),
       announceButton = Ti.UI.createButton({
           top: 16, width: 8 * 30, height: 48,
           title: "Make announcement"
       }),
       basicButton = Ti.UI.createButton({
           top: 16, width: 8 * 14, height: 48,
           title: "Basic",
           accessibilityHint: "Hint: pressing on this button does nothing."
       }),
       differentButton = Ti.UI.createButton({
           top: 16, width: 8 * 14, height: 48,
           title: "Different",
           accessibilityLabel: "This button has different text for accessibility."
       }),
       sw = Ti.UI.createSwitch({
           value: false,
           accessibilityLabel: "My special switch.",
           accessibilityValue: "Off.",
           top: 16
        
       }),
        
       eventLog = Ti.UI.createLabel({
           top: 16, left: 32, right: 32,
           height: Ti.UI.SIZE,
           verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP,
           accessibilityLabel: "My special label.",
           accessibilityValue: "No value.",
           accessibilityHint: "No action",
           accessibilityHidden: true
       }),
       versionParts = Ti.Platform.version.split(".");
        
       var buttonbarObjects = [
           {title:'Toggle Style', width:110, enabled:false},
           {image:'images/slider_thumb.png', width:50, accessibilityLabel: 'middle image'},
           {title:'Toggle Enabled', width:140}
       ];
       var bb4 = Titanium.UI.createButtonBar({
           labels:buttonbarObjects,
           backgroundColor:'red',
           style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
           width:'auto'
       });
        
       sw.addEventListener("change", function() {
           if (sw.value) {
               sw.accessibilityValue = "On.";
               sw.accessibilityHint = "Double tap to turn off."
           } else {
               sw.accessibilityValue = "Off.";
               sw.accessibilityHint = "Double tap to turn on."
           }
       });
        
       announceButton.addEventListener("click", function() {
           Ti.App.fireSystemEvent(Ti.App.EVENT_ACCESSIBILITY_ANNOUNCEMENT,
                                  "Please stand by for an urgent message from the Department of Home Land Security.");
       });
        
       function updateEventLog() {
           eventLog.text = "This label has the accessibilityHidden property set to true. ";
           eventLog.text += "This tells the accessibility service to ignore it. ";
           eventLog.text += "\n\n";
           eventLog.text += (Ti.App.accessibilityEnabled ? "Accessibility is enabled." : "Accessibility is disabled.");
           eventLog.text += "\n\nIf you go to Settings/General/Accessibility and disable/enable VoiceOver, the change will be reflected here.\n";
       }
        
       Ti.App.addEventListener(Ti.App.EVENT_ACCESSIBILITY_CHANGED, function(e) {
           updateEventLog();
       });
        
       var tableData = [ {title: 'Apples', accessibilityLabel:'Eat apples'}, {title: 'Bananas'}, {title: 'Carrots'}, {title: 'Potatoes'} ];
       var table = Ti.UI.createTableView({
         data: tableData
       });
       
       updateEventLog();
        
       winViews.add(basicButton);
       winViews.add(differentButton);
       winViews.add(sw);
       winViews.add(bb4);
       winTable.add(table);
       winEvents.add(announceButton);
       winEvents.add(eventLog);
        
       tabGroup.addTab(tabViews);
       tabGroup.addTab(tabTable);
       tabGroup.addTab(tabEvents);
       tabGroup.open();
       
       
  4. Max Stepanov 2012-09-18

    Implemented according to spec at https://wiki.appcelerator.org/display/pe/Titanium+Accessibility+Specification

    Test for regressions when accessibility is OFF.

    * Turn off any accessibility services that may be turned on on your device. * Create application with app.js provided above. * Run the app on iPhone device. * Go through the two tabs in the app. Make sure nothing is broken (note: the buttons don't show anything when you click them -- just be sure nothing causes a crash.) * On the second tab, "Events", make sure the label says that accessibility is disabled. * Back out of the app.

    Test Accessibility

    * Turn on VoiceOver and Hints in Settings/General/Accessibility. * Run the app again. * On the View Properties tab, select (without clicking) the Basic button. No accessibility properties are set on this button (thus "Basic"), so VoiceOver will simply do whatever it does by default, which is likely to say "Basic. Button.". * Now select (without clicking) the "Different" button. This button has its accessibilityLabel property set so as to override the default text that would otherwise be read aloud by VoiceOver. Instead of just saying "Different. Button." it should say "This has different text for accessibility. Button." * Now select the switch. It has three accessibility properties set: accessibilityLabel, accessibilityValue and accessibilityHint. These will be combined, and VoiceOver should say, "My special switch. Off. Double tap to turn on." * Now switch to the "Events" tab. * Select and click (in touch-by-explore this means double-tapping) the "Make announcement" button. You should hear an announcement, "Please stand by for an urgent message from the Department of Homeland Security." * Read the label field. Make sure it includes the text "Accessibility is enabled." * Try to select (with explore-by-touch) the label. It should not be possible, since the accessibilityHidden property is set to true. * Now keep the app running (do not terminate) and go back to Settings and disable VoiceOver. * Switch back to the app. The label should now include "Accessibility is disabled." * Switch back to Settings settings and re-enable VoiceOver. * Switch back to the app. *Note: iOS restarts application when it goes from VoiceOver=Off to VoiceOver=On, but not vice versa.* Switch to "Events" tab. The label should contain "Accessibility is enabled."
  5. Allen Yeung 2012-10-03

    PR: https://github.com/appcelerator/titanium_mobile/pull/2992
  6. Blain Hamon 2012-10-09

    Pull merged.
  7. Tamila Smolich 2012-10-15

    Verified feature works as expected. Testing environment: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 3.0.0.v20121014234610 Device: iPhone 4S (4.3.5)

JSON Source