From the course: Android App Development: Accessibility

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The ExploreByTouch helper: Part 2

The ExploreByTouch helper: Part 2 - Android Tutorial

From the course: Android App Development: Accessibility

Start my 1-month free trial

The ExploreByTouch helper: Part 2

- [Instructor] Now let's implement the unpopulated nodes for virtual ID. This method allows you to populate the virtual view with more information. This information is stored in the accessibility node info object, and it contains all the information that an accessibility service needs if you request for more information. So we can see here, in the method signature, that we get the virtual view ID and the accessibility node info. We can use this node to populate our information. We're going to set inside of this method two things. The spoken text, and the bounds for the virtual ID. The bounds are important so that Talkback users can explore the screen via touch. So first, based on the virtual view ID that was passed, let's get the entry. Let's declare final entry entry equals, from the list of entries, let's get the virtual view ID. Now, if we don't find the entry, let's throw an exception saying illegal argument exception. And let's say invalid virtual view ID. Okay, so now we need to…

Contents