2

I have enabled accessibility in my phone(galaxy S6), then try to have a voice recording after clicking on a button. This button has a contentDescription attribute with a long message. The problem is Talkback continues to give directions during voice message recording. I tried to stop it while audio recording by making empty the contentDescription or using setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO), but none of them pause the talkback voice. Is there any way for stopping taking?

mary
  • 369
  • 1
  • 5
  • 16
  • As an Android and Accessibility expert, I would encourage you to reconsider your design, over implementing this behavior. When you're thinking along the lines of "intentionally interfering with assistive technologies" more often then not, you're just going to make things worse. There are MANY WCAG criteria that apply to this, in each, it is the media content that is considered interfering, NOT the assistive technology feedback. – MobA11y May 08 '17 at 18:00

2 Answers2

1

I am not sure whether this is a good solution but it works for me:

public boolean onTouch(View v, MotionEvent event) {
            int action = event.getAction();// & MotionEvent.ACTION_MASK;
            if (action == MotionEvent.ACTION_DOWN) {
                mChatAudioLabel.setText(getString(R.string.To_cancel_swipe_and_release));
                AccessibilityManager manager = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE);
                boolean isAccessibilityEnabled = manager.isEnabled();
                if (isAccessibilityEnabled) {
                    AccessibilityEvent accessibilityEvent = AccessibilityEvent.obtain();
                    accessibilityEvent.setEventType(AccessibilityEvent.TYPE_ANNOUNCEMENT);
                    accessibilityEvent.setClassName(getClass().getName());
                    accessibilityEvent.getText().add("\u00A0");
                    manager.sendAccessibilityEvent(accessibilityEvent);
                }

I hope it is useful for others

mary
  • 369
  • 1
  • 5
  • 16
0

Is there a problem with shortening the content description? Why does a button who's job is to "Start Recording" have a content description that says anything but "Start Recording". This is very confusing indeed. I've never SEEN a button with a paragraph of text. Perhaps the information in the content description of your button belongs somewhere else...

MobA11y
  • 18,425
  • 3
  • 49
  • 76
  • it's content description is Voice recording button, hold to record voice. So when ,voice recording is started , it hasn't yet finished all the sentences. – mary May 09 '17 at 00:21
  • That content description is too long. Does the text on your button actually say that? Do the images on your button convey all of that information? How does a sighted user know to hold the button? Don't assume, that because a person is blind, that they cannot look around your app for contextual information. Adding "off screen" text to a content description is a hack fix for poor design, and very frustrating for a subset of Assistive Technologies where concise descriptions are paramount, cough, braille boards. Leave content descriptions concise, and let the rest of your app provide context. – MobA11y May 09 '17 at 05:07
  • In conclusion, the proper content description for your button is likely "Record" and if the user doesn't know from the rest of your app what that button does and how it works... well, that is a problem isn't it? But, not the button's problem. – MobA11y May 09 '17 at 05:09