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.
Handle custom accessibility actions - Android Tutorial
From the course: Android App Development: Accessibility
Handle custom accessibility actions
- [Instructor] Now that we have all the actions accessibility service, we will report that there will be additional actions available. However, we still don't know what to do when the user performs the action. To do that, all we need to do is to override a new method. So hit command N or alt insert, override method, and select perform accessibility action. Notice that this method returns a Boolean. If it's true, it means that the action was successfully completed and false means the action was not completed. It also accepts an action ID so this is what we're gonna use to determine which action the user clicked. So here we're going to do a switch action and based on the ID, we will do the action that we need. So for the first case, which is the like button, we're going just to call holder.onClick and then pass the button. This is exactly the same method that is called when the user clicks the button. Notice that we also have the problem that the holder is not final. Hit alt enter and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Grouping content5m 53s
-
(Locked)
Accessibility actions overview2m 10s
-
(Locked)
Remove extra accessibility focus2m 39s
-
Create custom accessibility actions5m 16s
-
(Locked)
Handle custom accessibility actions5m 20s
-
(Locked)
Accessible data visualization1m 50s
-
(Locked)
The ExploreByTouch helper: Part 15m 15s
-
(Locked)
The ExploreByTouch helper: Part 28m 47s
-
(Locked)
Using the ExploreByTouch helper7m 43s
-
(Locked)
-
-