Hi all.

I'm working on an Android application where we have a custom view and draw 
everything on a Canvas. I've watched the Google I/O 2012 accessibility video 
that discusses this exact scenario and it gives some pointer on how to get 
started. I have however failed to make this work as I expected it to.

We're aiming to support this on Jellybean and up, so I'm trying to use the new 
level 16 APIs for this.

Here is how it's currently setup.

We override "public boolean dispatchHoverEvent(MotionEvent ev)" and send off an 
accessibility event of type TYPE_VIEW_HOVER_ENTER and fill the event with the 
text content of the virtual child (getText.add and content description).

We also provide a AccessibilityNodeProvider and create the virtual hierarchy 
via createAccessiblityNodeInfo() callback (first the View.NO_ID where we add 
all the children, and then one callback for each child where we populate the 
virtual child info).

Now, I get all the callbacks and it seems as if it should be working. However, 
with this approach, we get no accessibility focus nor any talkback when 
clicking anywhere in the custom view. By playing around, I changed the event 
type we send off from dispatchHoverEvent to be TYPE_VIEW_ACCESSIBILITY_FOCUSED 
instead, and now the custom view gains accessibility focus.

However, it seems that the virtual views never get accessiblity focus and never 
gets turned to speech via talkback. In order to support the swipe navigations, 
etc, I would expect that they would gain this focus based on the bounds we give 
the node info for each child.

I have found zero working examples of applications that use these new APIs, and 
debugged and played around for 2 days without any success.

Could anyone give some pointers to proper examples, or any ideas on what might 
be missing? Have I misunderstood the function of the virtual views?

Thank you in advance.

Cheers, Andreas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to