Making Airbnb’s Android app extra accessible | by Julia Fu | The Airbnb Tech Weblog | Jan, 2023

By: Julia Fu, Peter Elliott

Decorative image for the blog post.

At Airbnb, we’ve been consciously designing and constructing merchandise to be equally usable by all customers. Making our cellular apps and web sites extra accessible not solely aligns with our firm’s mission of making a world the place individuals can belong anyplace, but in addition helps the civil rights of individuals with disabilities and complies with the legislation.

On this article, we spotlight a few of the efforts we’ve made to make the app extra accessible, for instance, labeling UI parts, grouping associated content material, supporting massive font scale, offering heading and web page names. The Airbnb app is likely one of the hottest journey apps with thousands and thousands of customers and helps many options. Making such a posh app extra accessible is a big endeavor that we’re constantly engaged on.

At Airbnb, we comply with business greatest practices to make the Android app accessible. In case you are , you’ll find all greatest practices we comply with from the official Android documentation for platform particular pointers and the Web Content Accessibility Guidelines as an business normal. Right here we wish to spotlight a number of examples the place we apply one of the best practices:

Finest Follow: content material descriptions

The whole lot shall have correct content material descriptions until they need to be ignored by assistive expertise. In these examples, the share button has a content material description that TalkBack reads aloud. TalkBack skips the home icon.

Share button highlighted on a listing page. TalkBack output says ‘Share, Button’.
Row highlighted with a star icon, bolded and underlined text, another icon with text, and subtitle text on a listing page. TalkBack output omits content for the icons and says ‘Rated 4.88 out of 5 from 203 reviews. Superhost Willington, Connecticut, United States’.

Finest apply: grouping

Components of a pure group may be introduced along with focusable containers for higher usability and accuracy. As an example, Talkback reads all itemizing content material on the cardboard collectively.

Listing card with a photo, rating, title, and price highlighted on a listing collections page. TalkBack output reads all the information together.

Finest apply: font scale

UI shall be usable when the person will increase the system font scale.

Default vs enlarged font scale:

A listing search page with a search bar, tabs with category names, two listing cards, a floating Map button, and a navigation bar at the bottom
Same page in a larger font, with only the first listing card visible
Default font scale on the left. Enlarged font scale on the precise.

Scaling greatest practices

The Airbnb Android app is a big app with many screens. It could be exhausting and never scalable if we would have liked so as to add accessibility code in all places. Luckily, our Design Language System permits us to broadly apply these greatest practices throughout product surfaces in a extremely environment friendly manner. Each display is constructed with a set of reusable UI parts. Once we enhance the accessibility for one part, the change applies to all of the pages with this part as a part of the view. This has a long-lasting optimistic impact on our app’s accessibility enhancements. Right here’s an instance:

The accessibility filters screen for a stay includes a large icon, a heading, subheadings, multiple checkbox options for various features (such as “no stairs or steps to enter”), and a footer..
The same screen with component names overlaid on top, such as DocumentMarquee for the heading, LeadingIconRow and CheckboxRows.

Take SectionHeader for instance. This UI part is used to speak the construction on the web page and group content material collectively. We mark this part to be an accessibility heading within the part code so it’s accessible in all screens that include this part.

We invested in automated accessibility testing and linting to run with each code commit, which creates a fast suggestions loop for engineers and empowers them to make the app accessible at code writing time. The checks are quick, dependable, and scale properly with our fast-growing options within the Android app.

Automated testing

We arrange Espresso-based automated testing to examine for accessibility points. Espresso is a well-liked testing library for Android UI with built-in accessibility checks. It helps a complete set of accessibility guidelines and is straightforward to arrange:

If accessibility checks fail, the take a look at outputs an error stack hint that engineers can use to debug the difficulty. For instance:

On this instance, engineers can present a content material description to the picture view to fulfill accessibility necessities.

We additionally screenshot take a look at our parts with a bigger font measurement to make sure the habits is right utilizing Happo.

A screenshot test of the marquee component using a larger system font. The marquee component contains a vertical stack with an icon, smaller kicker text, larger title text, and smaller subtitle text.

Linting

Along with automated testing, we additionally enabled linting, together with Android Lint guidelines for accessibility and customized lint guidelines constructed with Ktlint.

Right here is an instance of an Android accessibility lint rule:

Moreover the built-in Android Lint, we additionally use Ktlint to construct customized lint guidelines. As an example, when a person navigates to a brand new display, we offer a web page title for a display reader to announce. We use the next rule to guarantee that the web page title is localized.

Lint guidelines are easy to arrange and supply well timed suggestions, however linting has limitations — it could solely carry out static code evaluation.

Right this moment, these automated checks run as a part of CI (Steady Integration) checks for each code commit. If a pull request doesn’t go the checks, it is going to be blocked from being merged into the first code department. We nonetheless use handbook testing to cowl the areas that automated checks don’t cowl, such because the traversal order of UI parts on a web page. Automated and handbook checks complement one another properly.

Over the previous yr, we’ve been integrating Jetpack Compose into our app. Google’s Accessibility in Compose documentation has been an incredible useful resource to make sure our Compose parts and screens stay accessible. Whereas there are some notable issues lacking that existed with Views (e.g. focus order modification), Compose continues to be a younger library and we stay up for future enhancements. Listed below are a few issues value mentioning about our Compose-specific accessibility tooling:

Proactively encourage content material descriptions within the API

One among our pointers for UI parts is that content material descriptions uncovered by way of a operate parameter mustn’t use a default worth. This brings accessibility to the highest of thoughts when an engineer makes use of the part as they should think about what worth to go. A null worth continues to be acceptable in instances the place that UI factor isn’t necessary for accessibility.

A screenshot of an IconRow component that shows an icon beside two lines of text.

Web page title bulletins

A screenshot of several photos of a listing with the up button focused in the toolbar. The TalkBack output says “Photo tour of the listing”. We allow hosts to add captions for photos. If captions are provided, they are announced by Talkback when a user clicks on the photo. If no captions are provided, we do not generate them.

When utilizing Fragments and Views, we use the View.setAccessibilityPaneTitle() and View.announceForAccessibility() APIs when navigating to a brand new display to announce a descriptive web page title to the person. These APIs don’t exist in Compose however we wished to maintain the performance because it helps to offer extra context as to what the brand new display shows. Our present workaround units sure semantics on the display’s outer composable:

We use the liveRegion property so modifications may be introduced when the content material description modifications. That is helpful for pages whose total content material is set by a response from the server. On this case, TalkBack would announce “Content material Loading” whereas the community request is pending, adopted by “Content material Loaded” when it completes, and eventually the web page description outlined within the server response. One draw back of this method is that it requires the outer container to be focusable, which requires a further navigation motion to get to the content material.

Making our Android app extra accessible has been an impactful journey. Enhancing app accessibility entails following greatest practices, including rigorous enforcements, frequently studying from errors, and placing within the work. All of those are worthy efforts to verify an app works for all customers.

In case you are enthusiastic about constructing extremely accessible merchandise and the framework to assist them, take a look at a few of our associated open positions:

Staff Android Software Engineer, Guest

Senior iOS Software Engineer, Infrastructure

It’s a large endeavor to make a posh app just like the Airbnb Android app extra accessible. This work wouldn’t be potential with out the large efforts from the digital accessibility workforce and the close-knit Android neighborhood at Airbnb. Each engineer has contributed to creating the options they personal accessible. Making the Android app extra accessible is an ongoing effort and it couldn’t succeed with out all of them.

All product names, logos, and types are property of their respective homeowners. All firm, product and repair names used on this web site are for identification functions solely. Use of those names, logos, and types doesn’t indicate endorsement.

All bookings included on this weblog put up are meant for example. Airbnb doesn’t endorse or promote these listings or another lodging or experiences on the platform.