google/Accessibility-Test-Framework-for-Android

Feature request: Add option to specify minimum touch target sizes

ta-mbrizic opened this issue · 2 comments

Description

Currently, minimum touch target sizes are hardcoded to 48dp and there is no way to change them.

We need a way to override them, like it's possible to do so in the Accessibility Scanner app.

If you're using the accessibility test framework APIs directly, you can accomplish this with Parameters#putCustomTouchTargetSize(int). That Parameters instance would be passed to TouchTargetSizeCheck's #runCheckOnHierarchy.

if you're using our library via Espresso's integration, we don't currently have a convenience API for this in AccessibilityValidator, but it would be possible to add one. Is that what you're looking for here?

hemor commented

@caseyburkhardt I'm not the original author but I have a similar issue. Yes, it would be great if the espresso integration provides a convenience API for overriding this, and other available options. In the meantime, is there any workaround for achieving this?

Also, regarding the first part of your comment about using the accessibility test framework API directly, can you please provide more info on how to integrate this? The readme for the repo doesn't provide a ton of info and when I checked on how to use this, the only resource I found is this Google codelabs, and that uses the espresso integration, not the direct API. If you can provide/point me to where to find docs, articles, blogpost or sample codes on how to integrate the direct API in tests, that'd be really helpful.