Pergunta

I have a navigation drawer in my app that works perfectly. However in Accessibility mode with Talkback enabled, when moving over the home button that opens and closes the navigation drawer, it always says "close navigation drawer", even when the drawer is closed and hidden. Is this a bug with Talkback? Or am I not setting the states properly?

Foi útil?

Solução 2

The ActionBarDrawerToggle widget calls ActionBar.setHomeActionContentDescription(), which doesn't automatically update the content description under API 18 or the initial release of API 19. This was fixed in 4.4.2, but you can work around this in earlier versions by poking the action bar and forcing it to recompute its content description.

Try calling one of the following on your action bar (using support lib as necessary):

setHomeButtonEnabled(true)
setTitle(getTitle())
setSubtitle(getSubtitle())

Outras dicas

For posterity:

I had the same problem and Alanv's answer helped me. another thing to be aware of, adding to that, is that you should be sure that you're calling through to super.onDrawerOpened() and super.onDrawerClosed() in your implementation of ActionBarDrawerToggle.

If you do not do this, then the base class methods will not be called, which in turn, will not set the Action Bar content description as desired.

See the Source code for ActionBarDrawerToggle for details.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top