Name Date Size #Lines LOC

..--

.github/workflows/H25-Apr-2025-2419

gradle/wrapper/H25-Apr-2025-65

src/main/H25-Apr-2025-38,82422,609

.gitignoreH A D25-Apr-2025845 6851

Android.bpH A D25-Apr-2025760 2726

LICENSEH A D25-Apr-202511.1 KiB202169

METADATAH A D25-Apr-2025557 1715

MODULE_LICENSE_APACHE2HD25-Apr-20250

OWNERSH A D25-Apr-202551 21

README.mdH A D25-Apr-20251.7 KiB4737

build.gradleH A D25-Apr-20254.3 KiB139126

gradle.propertiesH A D25-Apr-202525 21

gradlewH A D25-Apr-20255.6 KiB186125

gradlew.batH A D25-Apr-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