-1

I'm implementing Accessibility in my application. Here's the scenario :

I have 4 buttons arranged horizontally at the very top of the screen (Activity). On the click of a button, I'm launching an Alert Dialog which displays something to the user. With the alert being displayed, I will still be able to perform click operations on those 4 buttons at the top of the screen. When I turn ON TalkBack (Android Accessibility Service) in Android device and click on that button, alert is getting displayed but I'm unable to move the focus (a yellow rectangular box which will be there when TalkBack feature is turned ON in Android phone) to those 4 buttons. Please help!

Rakesh
  • 1,205
  • 1
  • 14
  • 33
  • Do you have a page and/or sample code? Are you moving focus into the alert? Is it an alert or a dialog? See why having a URL to test would be handy? – aardrian Dec 07 '16 at 22:05
  • @aardrian , I'm moving focus into the alert. But when the user swipes to reach the focus to those 4 buttons, focus is not moving there; rather the focus stays only within the alert. I would like the focus to move out of the alert with the alert still being displayed on the screen. I'm dislaying alert using a custom class which extends AlertDialog. – Rakesh Dec 08 '16 at 12:42
  • 1
    A true alert dialog should prevent focus from leaving until it has been dismissed or another action within it has been taken. Again, without seeing a URL I cannot be certain, but I think your *non*-TalkBack experience may be broken. – aardrian Dec 08 '16 at 14:18
  • @aardrian, I completely agree that a true alert dialog shouldn't let the user to use any of the widgets on screen unless the alert dialog is dismissed. But in my case, I have the requirement like that. i.e. even if the alert is displayed, those 4 buttons on the top should take the click actions in non-TalkBack scenario. Trying to achieve the same with TalkBack ON scenario as well. Is there any way to achieve it? – Rakesh Dec 09 '16 at 03:18
  • Again, need to see your code. Probably remove any role you have and just make it a live region. Or push back on the stakeholder. – aardrian Dec 09 '16 at 14:50

3 Answers3

0

Try to set the below properties to your buttons

android:importantForAccessibility="yes" android:focusable="true"

vijesh
  • 1
0

You won't be able to do it with a dialog, you'll need to fake it with a View.

Perhaps you are using the wrong component which is why it sounds odd when you describe it? A picture of your design would help provide some context.


As @aardrian says, the alert dialog is modal and will (and does) block user input from the underlying UI. Clicking away from the dialog or pressing back will dismiss the dialog.

With TalkBack enabled, the user will be able to press the system back button, use the back gesture (swipe down, then left) or select an option within the dialog to dismiss it.

ataulm
  • 15,195
  • 7
  • 50
  • 92
0

Try to integrate voice control into your application via Accessibility TalkBack

Define 4 buttons, Alert Dialog Box as objects, selected by voice: button 1 button 2 ...

... I am studying the limitations of voice control of Android smartphone/ device in Blind Mode ( eyes-free)

darius
  • 1
  • 1
  • 5