0

In my application I use DrawerLayout to show same help information. So I put it over actuall activity. Now I want to add TalckBack function and I cannot make that the any of view in DrawerLayout get the yellow rectangle (which marks focus in talkback mode). The Drawerlayout view is loaded on demand by inflantign it.

drawerLayout = (DrawerLayout) ((Activity) mContext).findViewById(R.id.drawer);
drawerHelp = (RelativeLayout) LayoutInflater.from(mContext).inflate(R.layout.help, drawerLayout, false);

What I try:

in xml add:

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

In code:

requestChildFocus()
requestFocus()
requestChildFocusFromTouch()

but still no luck. So how to force the rectangle mark in talkback mode for ImageButton?

LunaVulpo
  • 3,043
  • 5
  • 30
  • 58
  • possible duplicate of [Android - prevent TalkBack from announcing TextView title aloud](http://stackoverflow.com/questions/15723797/android-prevent-talkback-from-announcing-textview-title-aloud) – rds Sep 23 '14 at 11:37

1 Answers1

0

I solve my problem by adding

android:importantForAccessibility="no"

to all element in drawer layout and to other not nedeed elements in help layout.

LunaVulpo
  • 3,043
  • 5
  • 30
  • 58