• Home
Name Date Size #Lines LOC

..--

.github/workflows/04-Jul-2025-2419

gradle/wrapper/04-Jul-2025-65

src/main/04-Jul-2025-38,82422,609

.gitignoreD04-Jul-2025845 6851

Android.bpD04-Jul-2025760 2726

LICENSED04-Jul-202511.1 KiB202169

METADATAD04-Jul-2025815 2119

MODULE_LICENSE_APACHE2D04-Jul-20250

OWNERSD04-Jul-202551 21

README.mdD04-Jul-20251.7 KiB4737

build.gradleD04-Jul-20254.3 KiB139126

gradle.propertiesD04-Jul-202525 21

gradlewD04-Jul-20255.6 KiB186125

gradlew.batD04-Jul-20252.6 KiB9068

README.md

1# Accessibility Test Framework for Android
2
3To help people with disabilities access Android apps, developers of those apps
4need to consider how their apps will be presented to accessibility services.
5Some good practices can be checked by automated tools, such as if a View has a
6contentDescription. Other rules require human judgment, such as whether or not a
7contentDescription makes sense to all users.
8
9For more information about Mobile Accessibility, see
10http://www.w3.org/WAI/mobile/.
11
12This library collects various accessibility-related checks on View objects as
13well as AccessibilityNodeInfo objects (which the Android framework derives from
14Views and sends to AccessibilityServices).
15
16## Building the Library
17
18The supplied gradle wrapper and build.gradle file can be used to build the
19Accessibility Test Framework or import the project into Android Studio.
20
21```shell
22$ ./gradlew build
23```
24
25## Sample Usage
26
27Given a view, the following code runs all accessibility checks on all views in
28the hierarchy rooted at that view and throws an exception if any errors are
29found:
30
31```java
32ImmutableSet<AccessibilityHierarchyCheck> checks =
33    AccessibilityCheckPreset.getAccessibilityHierarchyChecksForPreset(
34        AccessibilityCheckPreset.LATEST);
35AccessibilityHierarchyAndroid hierarchy = AccessibilityHierarchyAndroid.newBuilder(view).build();
36List<AccessibilityHierarchyCheckResult> results = new ArrayList<>();
37for (AccessibilityHierarchyCheck check : checks) {
38  results.addAll(check.runCheckOnHierarchy(hierarchy));
39}
40List<AccessibilityHierarchyCheckResult> errors =
41    AccessibilityCheckResultUtils.getResultsForType(
42        results, AccessibilityCheckResultType.ERROR);
43if (!errors.isEmpty()) {
44  throw new RuntimeException(errors.get(0).getMessage().toString());
45}
46```
47