<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sigute</title>
    <description>The latest articles on DEV Community by Sigute (@sigute).</description>
    <link>https://dev.to/sigute</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F228865%2Fd5d617cf-ae0f-4178-b957-f90aad717930.jpeg</url>
      <title>DEV Community: Sigute</title>
      <link>https://dev.to/sigute</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sigute"/>
    <language>en</language>
    <item>
      <title>Accessible Text Scaling for Android</title>
      <dc:creator>Sigute</dc:creator>
      <pubDate>Thu, 11 Mar 2021 20:18:08 +0000</pubDate>
      <link>https://dev.to/sigute/accessible-text-scaling-for-android-1ham</link>
      <guid>https://dev.to/sigute/accessible-text-scaling-for-android-1ham</guid>
      <description>&lt;p&gt;Do you ever open the app and cannot read the full text because it's cut off in some way? This scenario became frequent to me once I increased the font size on my phone. Technology agency from the Netherlands, Q42, carried out &lt;a href="https://accessibility.q42.nl/" rel="noopener noreferrer"&gt;extensive research&lt;/a&gt; on 1.5 million iOS users and found that as many as 33% of people change the text size on their phone, and increasing text size is more common than making the text size smaller (20% increasing vs 13% decreasing). With such a large percentage, it is reasonable to assume that Android users likely also change these settings in similar frequency.&lt;/p&gt;

&lt;p&gt;That is a big group of people, which makes it really important to consider how this setting will be supported when developing and testing your apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common issues and solutions
&lt;/h2&gt;

&lt;p&gt;I have been using various apps on my phone with non-default text and density settings. Reducing font size rarely causes any issues. However, even slightly larger than the default font size often means that a lot of issues appear. The following problems are the most common and often easily fixed.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Text does not scale
&lt;/h3&gt;

&lt;p&gt;In some apps, after changing the font size, the text does not scale up at all. This is the number one issue on the list. While the layout is displayed correctly and text is visible, the user is not able to gain any benefit from the device setting and, as such, will struggle with reading the text.&lt;/p&gt;

&lt;p&gt;Most of the time this is caused by using &lt;code&gt;dp&lt;/code&gt; for text sizing instead of &lt;code&gt;sp&lt;/code&gt;. &lt;code&gt;dp&lt;/code&gt;, density-independent pixels, are used for displaying consistently sized user interface across any screen size. &lt;code&gt;sp&lt;/code&gt;, scalable pixels, have the same default value as &lt;code&gt;dp&lt;/code&gt;. However, &lt;code&gt;sp&lt;/code&gt; changes with the user's font preference and &lt;code&gt;dp&lt;/code&gt; does not. This means &lt;code&gt;sp&lt;/code&gt; should be used for text elements so the size of the text will increase or decrease with the device setting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzxdfetvttpwttd4v354.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzxdfetvttpwttd4v354.jpeg" alt="Screenshot shows text in sp and dp, when device font size is increased, only sp text is scaling up"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this screenshot, you can see how the text defined in &lt;code&gt;dp&lt;/code&gt; remains the same size regardless of the user's font preference.&lt;/p&gt;

&lt;p&gt;In other cases, the text does not scale because it is part of the image, instead of TextView. Providing content description is important for these scenarios, however just providing content description is not enough for an accessible solution. Not every user with vision issues is using Talkback: a better approach is using TextView over the image, as then the text size can still be increased.&lt;/p&gt;

&lt;p&gt;Lastly, &lt;a href="https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview" rel="noopener noreferrer"&gt;autosizing TextViews&lt;/a&gt; can also cause the issue of the text not scaling in an expected way. This solution ensures that the text fits inside the view nicely and layouts do not break, but this doesn't always provide a benefit if the user is not able to easily read the text at that size. The limits need to be set carefully and testing with different font and density combinations will help to spot issues when using autosizing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjd79t45yui14g4il5mm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjd79t45yui14g4il5mm.png" alt="Image shows autosizing and not autosizing text views with different font sizes, neither having ideal behavior"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the screenshot, the top TextViews do not use autosizing, meaning the text does not fit as it grows longer and the font size is increased. With autosizing, the issue appears to be fixed, as all the text is visible. However, it is not a full solution, as while the text is now visible it is very small. In this case there is no easy fix in the code, and the design should be reimagined to support longer text better. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Text is cut off
&lt;/h3&gt;

&lt;p&gt;In this scenario the text is cut-off in some way. Often half a line or the end of the text is missing. This usually indicates an issue with the layout constraints.&lt;/p&gt;

&lt;p&gt;To resolve this, prefer &lt;code&gt;wrap_content&lt;/code&gt; and &lt;code&gt;minHeight/Width&lt;/code&gt; over hardcoding layout limits. This allows the content to scale to different lengths and sizes. When using constraint layout, make sure to set start AND end constraints, so the view does not end up out of visible screen space.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnapswflot06cb7nedfc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnapswflot06cb7nedfc6.png" alt="Screenshot showing an example of text getting cut off at larger font sizes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this screenshot, TextView height is constrained, so when the text grows beyond the height, it gets unreadable. In the code below, adding the &lt;code&gt;minHeight&lt;/code&gt; attribute instead of fixed height allows the field to grow and remain usable.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
            &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
            &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"32dp"&lt;/span&gt;
            &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;
            &lt;span class="na"&gt;android:textSize=&lt;/span&gt;&lt;span class="s"&gt;"48sp"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
            &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
            &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
            &lt;span class="na"&gt;android:minHeight=&lt;/span&gt;&lt;span class="s"&gt;"32dp"&lt;/span&gt;
            &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;
            &lt;span class="na"&gt;android:textSize=&lt;/span&gt;&lt;span class="s"&gt;"48sp"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fquynrh5e3yveai5b7j6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fquynrh5e3yveai5b7j6c.png" alt="Screenshot showing two text elements, and in the first case, text goes beyond the boundary of the screen."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this screenshot, the text has grown beyond the boundary of the screen. This can easily happen if the content is coming from the API and is longer than it was initially expected to be, especially with increased font size. Where no issues would happen in the following code example with short text, it's important to think about having constraints at both sides of the elements to avoid issues when the text length changes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

    &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class="na"&gt;android:id=&lt;/span&gt;&lt;span class="s"&gt;"@+id/title"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_marginStart=&lt;/span&gt;&lt;span class="s"&gt;"40dp"&lt;/span&gt;
        &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"Title"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"0dp"&lt;/span&gt;
        &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"@string/long_text"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintStart_toStartOf=&lt;/span&gt;&lt;span class="s"&gt;"@+id/title"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintTop_toBottomOf=&lt;/span&gt;&lt;span class="s"&gt;"@+id/title"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Adding a constraint for the end as well fixes this issue and all text remains visible.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

    &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"0dp"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"0dp"&lt;/span&gt;
        &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"@string/long_text"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintEnd_toEndOf=&lt;/span&gt;&lt;span class="s"&gt;"@id/title"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintStart_toStartOf=&lt;/span&gt;&lt;span class="s"&gt;"@+id/title"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintTop_toBottomOf=&lt;/span&gt;&lt;span class="s"&gt;"@+id/title"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  3. Text overlays other elements
&lt;/h3&gt;

&lt;p&gt;In some cases, the views overlay each other. This causes unreadable screens, especially if several text views end up on top of each other. It can be caused by badly defined constraints. For example, an icon starts overlaying the text as the text becomes longer through the font sizing. This problem can also often be seen with translated text when some languages use much longer text than the one for which the app was designed in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0buednugfuqk1sd6av7.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0buednugfuqk1sd6av7.jpeg" alt="Screenshot showing icon overlaying text view at larger font size and fixed version"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the screenshot, TextView is not constrained at the end and grows to overlay the icon. This makes it hard to read the text and to see what the icon is to get more context. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

    &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;
        &lt;span class="na"&gt;android:textSize=&lt;/span&gt;&lt;span class="s"&gt;"20sp"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintStart_toStartOf=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;ImageView&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
        &lt;span class="na"&gt;android:src=&lt;/span&gt;&lt;span class="s"&gt;"@drawable/ic_android"&lt;/span&gt;
        &lt;span class="na"&gt;app:layout_constraintEnd_toEndOf=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt;
        &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To fix this, TextView is constrained against the icon, so the elements cannot end up on top of each other.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;span class="nt"&amp;gt;&amp;amp;lt;TextView&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;android:layout_width=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"0dp"&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;android:layout_height=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"wrap_content"&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;android:text=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"Hello World"&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;android:textSize=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"20sp"&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;app:layout_constraintStart_toStartOf=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"parent"&amp;lt;/span&amp;gt;
    &amp;lt;span class="na"&amp;gt;app:layout_constraintEnd_toStartOf=&amp;lt;/span&amp;gt;&amp;lt;span class="s"&amp;gt;"@+id/image"&amp;lt;/span&amp;gt; &amp;lt;span class="nt"&amp;gt;/&amp;amp;gt;&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  

&lt;ol&gt;
&lt;li&gt;Unusable ellipsizing
&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;


&lt;p&gt;Another common issue is when the text scales or when the content is longer than planned for and it becomes ellipsized. Ellipsizing by itself is not an issue, it is a great technique to use in some scenarios. For example, if the user is looking at a preview of an article and can click through to the details to read more. However, the information can be easily lost in snackbars, titles, or error messages, especially if there is something crucial at the end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1zts4svgz6g7gcdq93i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1zts4svgz6g7gcdq93i.png" alt="Screenshot showing an error message with the number at the end cut off at larger font size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are various ways to fix this; one method is that the views could be set to allow multiple lines if the text can potentially expand over the limit. It is also helpful to think about whether the content needs to be fully visible to the user on their current screen (text in the article, error message) or whether it could be ellipsized and still make sense without the full text (clickable title in a list which links to detail).&lt;/p&gt;

&lt;h2&gt;
  
  
  How to test
&lt;/h2&gt;

&lt;p&gt;There are a few ways to test and catch most of these scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Android Studio
&lt;/h3&gt;

&lt;p&gt;When editing a layout in Android Studio, the layout can be previewed in different devices, which helps to catch issues with smaller screen sizes.&lt;/p&gt;

&lt;p&gt;Android Studio also includes the Layout Validation tool which can show a preview with different font sizes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk6i6moo9bpuxft8m1flu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk6i6moo9bpuxft8m1flu.png" alt="Screenshot from Android Studio showing Layout Validation tool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Device testing
&lt;/h3&gt;

&lt;p&gt;Manual testing on a device or an emulator helps to catch issues as well. Often, a small set of emulators is enough, as the device settings can be used to test different configurations. My approach is modifying the font size first and then the display size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0fcz4wdvyzibrfmv32d.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0fcz4wdvyzibrfmv32d.jpeg" alt="Screenshot showing Android font and display size settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  To sum up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Plan for flexible layouts and consider what happens when text expands beyond the default size.&lt;/li&gt;
&lt;li&gt;Test with different font and display sizes to find issues with scaling.&lt;/li&gt;
&lt;li&gt;We (mostly) don't build the apps just for ourselves: usability is important.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this article gave you some tools to make your apps better. Code examples in the article have been shortened to only show the important lines of code. A Github repository containing the full sample code used for examples and generating screenshots is available &lt;a href="https://github.com/sigute/TextViewSizingDemo" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>android</category>
      <category>a11y</category>
      <category>tutorial</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Nevertheless, Sigute Coded in 2020/2021!</title>
      <dc:creator>Sigute</dc:creator>
      <pubDate>Mon, 08 Mar 2021 20:07:07 +0000</pubDate>
      <link>https://dev.to/sigute/nevertheless-sigute-coded-in-2020-2021-5593</link>
      <guid>https://dev.to/sigute/nevertheless-sigute-coded-in-2020-2021-5593</guid>
      <description>&lt;p&gt;When I looked back at the past year, I asked myself, did anything really happen at all? It often felt and still feels like time became meaningless with days blending into each other... And, yet, I did realize that there achievements since last International Women's Day I would like to share! &lt;/p&gt;




&lt;p&gt;In April, I gave my first public talk about one of the last projects I worked on at Microsoft. Meetup/conference talks are something I would like to do more of in the future.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1255558306745274368-398" src="https://platform.twitter.com/embed/Tweet.html?id=1255558306745274368"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1255558306745274368-398');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1255558306745274368&amp;amp;theme=dark"
  }



&lt;/p&gt;




&lt;p&gt;I left Microsoft and joined a healthcare company that summer. I was working as a senior Android engineer for the first time! It was really exciting to finally have this title. &lt;/p&gt;

&lt;p&gt;To get to the senior engineer title, it took me Bachelors in Computing Science, Masters in Advanced Computer Science, 8 years of Android experience, Microsoft in my CV, and an internal referral!&lt;/p&gt;

&lt;p&gt;...I often wonder which of these circumstances finally did it.&lt;/p&gt;

&lt;p&gt;I am also aware that if it took me all this, it's something that's going to be even harder for many other women in this field who do not share the same privileges as me. My university degrees opened many doors, so did getting experience at a big company. I am an immigrant, but I am also white. I hear many disheartening stories and I hope that the resolutions towards more diverse workplaces that people and companies are making today will make a difference throughout the year.&lt;/p&gt;




&lt;p&gt;The company I joined was not a match in the end... I did carry out my second job search later in the year and have recently started at my new job. I am happy at my new workplace and hope to stay there for a long time :) &lt;/p&gt;




&lt;p&gt;Last year I also participated in a campaign that provides real-world case studies to help inspire girls to pursue a STEM career. I was really happy to be part of this. &lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1306872114050408448-342" src="https://platform.twitter.com/embed/Tweet.html?id=1306872114050408448"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1306872114050408448-342');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1306872114050408448&amp;amp;theme=dark"
  }



 &lt;/p&gt;




&lt;p&gt;For the next year, I am not making any big plans. I am mainly trying to learn as much as I can in my new job, and find a balance in my work and life. If I can share with the community more, and write some blog posts about areas that are important to me, it will make me happy.&lt;/p&gt;

</description>
      <category>wecoded</category>
      <category>womenintech</category>
    </item>
    <item>
      <title>Android Accessibility - Resolving common Talkback issues</title>
      <dc:creator>Sigute</dc:creator>
      <pubDate>Tue, 31 Mar 2020 07:29:28 +0000</pubDate>
      <link>https://dev.to/sigute/android-accessibility-resolving-common-talkback-issues-3moh</link>
      <guid>https://dev.to/sigute/android-accessibility-resolving-common-talkback-issues-3moh</guid>
      <description>&lt;h1&gt;
  
  
  Android Accessibility - Resolving common Talkback issues
&lt;/h1&gt;

&lt;p&gt;Many Android applications suffer from similar Talkback issues and at Microsoft To Do we run into these often as well. We use multiple strategies to make our app more accessible. This article covers a few scenarios where Talkback experience is improved.&lt;/p&gt;

&lt;p&gt;A companion Github repository containing the sample code is available &lt;a href="https://github.com/sigute/AccessibilityTipsDemo" rel="noopener noreferrer"&gt;here&lt;/a&gt;. You can check it out and try running the demo app on your device to experience the issues and try the solutions yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining views into groups
&lt;/h2&gt;

&lt;p&gt;Not everything visible on the screen is meaningful; some views are used only for decoration, some images illustrate the text without adding additional information, and sometimes multiple views convey the meaning together but do not make sense separately. In these cases, the views can be combined to allow Talkback user to quickly navigate entire view, rather than having to skip through multiple different elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgfdu1u3a991kkueqh5fx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgfdu1u3a991kkueqh5fx.png" alt="Screenshot showing Talkback navigation over ungrouped elements"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot showing Talkback navigation over ungrouped elementsTalkback reads the user element on the page as "User placeholder avatar", "Name", and then "Surname". Each element can be navigated individually. The user icon is a placeholder which does not provide additional information. It takes three swipes to navigate through the element.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhmey4wv0331v0efj0ztp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhmey4wv0331v0efj0ztp.png" alt="Screenshot showing Talkback navigation over group"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot showing Talkback navigation over groupContent description is set on the entire group so Talkback reads only one label, containing all user information as "Name Surname". Now navigation is done in only one swipe.&lt;/p&gt;

&lt;h3&gt;
  
  
  XML layout snippet
&lt;/h3&gt;

&lt;p&gt;Content description is set on LinearLayout, child views are marked as not important for accessibility individually.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nt"&gt;&amp;lt;LinearLayout&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;android:contentDescription=&lt;/span&gt;&lt;span class="s"&gt;"@string/content_description_user_combined"&lt;/span&gt;&lt;br&gt;
  &lt;span class="err"&gt;&amp;lt;ImageView&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;br&gt;
    &lt;span class="na"&gt;android:importantForAccessibility=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;
  &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;br&gt;
    &lt;span class="na"&gt;android:importantForAccessibility=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;
  &lt;span class="nt"&gt;&amp;lt;TextView&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;br&gt;
    &lt;span class="na"&gt;android:importantForAccessibility=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;span class="nt"&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Action descriptions&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;As Talkback navigates the elements with click actions, the announcement generated will include some information, for example "Login, Button, Double tap to activate". However, relying on default announcements is not always enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbv43am1ls2fh715wtaun.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbv43am1ls2fh715wtaun.png" alt="Screenshot showing Talkback announcements for the Button without custom actions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot showing Talkback announcements for the Button without custom actionsA button with two actions generates an accessibility announcement of "Edit note, Double tap to activate, Double tap and hold to long press".&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fya5fx8yru8d57kfrwm8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fya5fx8yru8d57kfrwm8k.png" alt="Screenshot showing Talkback announcements for the Button with custom actions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot showing Talkback announcements for the Button with custom actionsActions are modified to announce "Double tap to edit note, Double tap and hold to copy note".&lt;/p&gt;

&lt;h3&gt;
  
  
  Code snippet
&lt;/h3&gt;

&lt;p&gt;Custom actions are added in accessibility delegate, ensuring that it's clear what happens when each action is carried out.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nc"&gt;ViewCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAccessibilityDelegate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set_actions_button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;object&lt;/span&gt; &lt;span class="err"&gt;: &lt;/span&gt;&lt;span class="nc"&gt;AccessibilityDelegateCompat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
        &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AccessibilityActionCompat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;br&gt;
            &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ACTION_CLICK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Edit note"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;br&gt;
        &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AccessibilityActionCompat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;br&gt;
            &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ACTION_LONG_CLICK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Copy note"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;br&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;})&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Roles&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Talkback reads the element roles, such as Button, Switch, Checkbox, etc. This gets complicated when non-standard elements are used. For example, adding a click listener will add an action to Talkback announcement, but the role will generally not change, potentially causing confusion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8dmjcw92xl9rdr4pdfsa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8dmjcw92xl9rdr4pdfsa.png" alt="Screenshot showing examples of different types of buttons and Talkback announcements"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot showing examples of different types of buttons and Talkback announcementsThe button is announced as "Login, Button". Adding on a click listener to TextView does not include the "Button" announcement. In the last example, TextView is announced as "Button".&lt;/p&gt;

&lt;h3&gt;
  
  
  Code snippet
&lt;/h3&gt;

&lt;p&gt;Role is added by including it in the accessibility delegate. This is not an ideal solution; best practice is to use elements as intended, so using Button when Button behaviour is needed, which avoids the need to modify roles manually, as it is easy to miss some behaviour which comes by default. However, in some cases, this will help.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nc"&gt;ViewCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAccessibilityDelegate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;login_text_view_as_button_with_role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="kd"&gt;object&lt;/span&gt; &lt;span class="err"&gt;: &lt;/span&gt;&lt;span class="nc"&gt;AccessibilityDelegateCompat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
        &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
            &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
            &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;roleDescription&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Button"&lt;/span&gt;&lt;br&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;})&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Updating information after state changes&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Lint warning often reminds us about adding initial content descriptions, but for the elements with states, this might not be enough. It is important to remember to update accessibility information as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmd4d2m0z2xbelwh8fxzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmd4d2m0z2xbelwh8fxzu.png" alt="Screenshots showing Talkback announcements for Buttons where UI changes but accessibility information is not updated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshots showing Talkback announcements for Buttons where UI changes but accessibility information is not updatedThe favorite button is not updated after the user taps on it, so the Talkback announcement still reads "Not favorite item, Button, Double tap to activate" after the user already added the item to favorites and the UI is updated to reflect this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg7a19gi3elmhzuoq1zr4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg7a19gi3elmhzuoq1zr4.png" alt="Screenshots showing Talkback announcements with changed UI and accessibility information"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshots showing Talkback announcements with changed UI and accessibility informationFavorite button content and action descriptions are updated so Talkback reads one of two states: "Not favorite item, Button, Double tap to add to favorites" and "Favorite item, Button, Double-tap to remove from favorites".&lt;/p&gt;

&lt;h3&gt;
  
  
  Code snippet
&lt;/h3&gt;

&lt;p&gt;When a tap event is received and the element state changes, the content and action descriptions are updated to reflect the current state of the item. This is especially important for elements which represent On/Off state, like the favorite button. Alternatively, an element which already supports On/Off states could be used in this scenario, like Switch or Checkbox. On the other hand, if more than two states are available, then custom elements make sense.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="n"&gt;favorite_button_custom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contentDescription&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;"Favorite item"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s"&gt;"Not favorite item"&lt;/span&gt;&lt;br&gt;
&lt;span class="nc"&gt;ViewCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAccessibilityDelegate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;favorite_button_custom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;object&lt;/span&gt; &lt;span class="err"&gt;: &lt;/span&gt;&lt;span class="nc"&gt;AccessibilityDelegateCompat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onInitializeAccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
        &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AccessibilityActionCompat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;br&gt;
                &lt;span class="nc"&gt;AccessibilityNodeInfoCompat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ACTION_CLICK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;br&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;"Remove from favorites"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s"&gt;"Add to favorites"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;br&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;})&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  RecyclerView scrolling&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;If RecyclerView does not automatically scroll with Talkback navigation, it will make it very hard for Talkback users to know that there are more elements available. There is one common issue which usually causes this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx6140egglg0wj70zb2va.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx6140egglg0wj70zb2va.gif" alt="GIF showing side by side comparison of Talkback navigation of scrolling and non-scrolling RecyclerView"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GIF showing side by side comparison of Talkback navigation of scrolling and non-scrolling RecyclerViewThe first RecyclerView allows user to see the first 5 elements and then navigation skips the rest. The second RecyclerView moves to the 6th element in the list and scrolls down to make additional elements available. The focus only moves away from RecyclerView when all elements are visited.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layout snippet
&lt;/h3&gt;

&lt;p&gt;If the following line is in the RecyclerView layout, removing it will fix the issue. It will also add additional in/out of list announcements to help the users navigate.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nt"&gt;&amp;lt;androidx.recyclerview.widget.RecyclerView&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;br&gt;
    &lt;span class="na"&gt;android:importantForAccessibility=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt;&lt;br&gt;
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  RecyclerView focus&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;As is the nature of RecyclerView, it can recycle the view holders if there are changes to the data. However, this can create focus issues if some view is no longer displayed or the view holder is reused in a different position. Understanding what is happening will help with keeping the focus unchanged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqccq79sca90ohhkzt2p9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqccq79sca90ohhkzt2p9.gif" alt="GIF showing side by side Talkback navigation of RecyclerView with focus issues and a fix"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GIF showing side by side Talkback navigation of RecyclerView with focus issues and a fixRecyclerViews allow the user to mark elements as deleted. In the first RecyclerView, once the delete icon is tapped and the element text is replaced with "Deleted name", the focus returns to the top of the activity, so the user needs to navigate through the entire screen again to return to the original focus position. The second RecyclerView keeps the focus on the same element, shifting it from the icon to the name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code snippet
&lt;/h3&gt;

&lt;p&gt;After the element is marked as deleted there is a short delay to allow RecyclerView time to reuse ViewHolders, then the desired position is found and focus is returned to that position. If the underlying data set is not changed and there is no refresh of the data in RecyclerView adapter, this could potentially be solved within ViewHolder itself. As always, the best solution is the one which addresses the specific need.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="n"&gt;recycler_view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postDelayed&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;br&gt;
    &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;viewHolder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;recycler_view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findViewHolderForAdapterPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
    &lt;span class="n"&gt;viewHolder&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;itemView&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;requestFocus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;delay_in_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusions&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Accessibility is important for our team at Microsoft To Do. We spend a lot of time making sure every user can stay organised and accomplish more, independent of how they use their device. Most of our Android app releases include several accessibility improvements. We also work with our design team to consider accessibility requirements from the start.&lt;/p&gt;

&lt;p&gt;Accessibility issues we encounter range from simple to tricky - it takes time and dedication to find and resolve them all. I hope this article helps you to solve some. Code snippets in the article have been simplified for clarity, so check the sample code for full implementations.&lt;/p&gt;

&lt;p&gt;Is there a different way you would approach some of these? Let's discuss it!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was first published on Android@Microsoft Medium publication &lt;a href="https://medium.com/android-microsoft/android-accessibility-resolving-common-talkback-issues-3c45076bcdf6" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>a11y</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Improving Pull Request Process with Complexity Labels</title>
      <dc:creator>Sigute</dc:creator>
      <pubDate>Thu, 12 Mar 2020 18:11:17 +0000</pubDate>
      <link>https://dev.to/sigute/improving-pull-request-process-with-complexity-labels-5bgf</link>
      <guid>https://dev.to/sigute/improving-pull-request-process-with-complexity-labels-5bgf</guid>
      <description>&lt;p&gt;Does your team struggle with pull requests? Is there never enough time in the day to review others code? Do you feel like you need to keep asking your teammates for code reviews? Is the list growing everyday with no end in sight? Pull requests &lt;strong&gt;are&lt;/strong&gt; hard. Our Android team at Microsoft To Do made some changes recently to improve the process. I have suggested adding labels to pull requests and this article shows my solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is complexity
&lt;/h2&gt;

&lt;p&gt;To start with, I thought about how we define complexity. Take a moment to consider these: What makes a pull request easier or harder to review? Is there a type of pull request which always get merged straight away and another one that sits there for a long time? What's the difference between them?&lt;/p&gt;

&lt;p&gt;In general, the smaller the pull request, the easier and faster it should be to review. This is a good general rule, however one line change is not always straight forward in terms of impact. Fixing a typo is easy. Updating an external dependency also changes only a few characters, but might lead to the entire app breaking.&lt;/p&gt;

&lt;p&gt;However, considering only the number of lines of code changing can be misleading if it is the only way to think about complexity. On the other side of this, large pull requests are not necessarily complex. Renaming something might affect hundreds of files but the risk is low, especially with modern tools where forgetting some files is less likely. Adding in new translations could also generate very large changeset, but is unlikely to generate new bugs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Complexity Matrix
&lt;/h2&gt;

&lt;p&gt;After considering size and difficulty, I have arrived at complexity as the measure of pull request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Size x Difficulty = Complexity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have created this matrix as a way to think about complexity and roughly estimate where pull request might fall into.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3p6pceqsypx2omoqbdxj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3p6pceqsypx2omoqbdxj.png" alt="A table showing size and difficulty with 4 corners highlighted, summarised further below"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy - small size and low difficulty
&lt;/h3&gt;

&lt;p&gt;These are your small and simple pull requests. This is the quickest pull request type to review and the easiest to test. Changes are unlikely to cause further issues. These pull requests tend to get merged very quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Medium Low - large size and low difficulty
&lt;/h3&gt;

&lt;p&gt;These are pull requests which are large, but the changes themselves are trivial. They can take longer to review because of the size, but are also less likely to introduce further bugs.&lt;/p&gt;

&lt;p&gt;Where possible, it could be beneficial to split these pull requests into multiple smaller ones. &lt;/p&gt;

&lt;h3&gt;
  
  
  Medium High - small size and hard difficulty
&lt;/h3&gt;

&lt;p&gt;These are pull requests which do not change many lines of code, but could have a big impact. This includes changing business logic, UI elements, updating dependencies, etc. These changes can potentially have unforeseen effects, so need to be reviewed and tested carefully.&lt;/p&gt;

&lt;p&gt;This is the category where using strategies like A/B testing, feature flags and and staged releases could be very beneficial, so changes can be reverted easily in case of any issues, whether with code or with user impact (for example if new UI does not perform as well as expected).&lt;/p&gt;

&lt;h3&gt;
  
  
  Large - large size and hard difficulty
&lt;/h3&gt;

&lt;p&gt;The final category is the pull requests which are large and complex. This could be things like adding a new screen to the app, changing one dependency to another, refactoring, etc. The bigger a pull request grows in this area, the harder it is to keep track of changes and carry out a good code review.&lt;/p&gt;

&lt;p&gt;The best strategy here is to be careful about creating pull requests in this category. If the code changes are growing, could they be split across multiple code reviews? For example, for a new app feature, database changes could be reviewed separately from the UI layer. Using feature flags to hide code which is not ready for production yet helps with this, so the feature branch does not grow too much out of sync with the main branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to put this into practise
&lt;/h2&gt;

&lt;p&gt;We have started labelling our pull requests as part of the title and use t-shirt sizes as the complexity:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;S -&amp;gt; M -&amp;gt; L -&amp;gt; XL -&amp;gt; ... -&amp;gt; XXXXXXL?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Some examples of pull request titles would look like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[S] Fixed accessibility bug in X screen&lt;/p&gt;

&lt;p&gt;[M] Updated library Y dependency, please test&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alternative labels could include emojis!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🐇 -&amp;gt; 🦘 -&amp;gt; 🦙 -&amp;gt; 🦖&lt;/p&gt;

&lt;p&gt;😀 -&amp;gt; 🙂 -&amp;gt; 😐 -&amp;gt; 😭&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Be aware that emojis appear differently on other devices, dependent on platform, OS, and many other factors, so make sure the selected ones look good on all your teammates computers!&lt;/p&gt;

&lt;p&gt;If you want to use animal emojis, I have categorised some of them by size!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1234832806544625665-676" src="https://platform.twitter.com/embed/Tweet.html?id=1234832806544625665"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1234832806544625665-676');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1234832806544625665&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;As well as using the label as part of the title, you could make use of labels in your code review tools.&lt;/p&gt;

&lt;p&gt;If you are using Github, you can create custom labels and then add them to pull requests. Emojis and colours are supported and you will be able to filter by specific label.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzthbjipz0ji1ovj3totb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzthbjipz0ji1ovj3totb.png" alt="Screenshot of Github pull requests with custom complexity labels"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Impact of changes
&lt;/h2&gt;

&lt;p&gt;It has been a few weeks since our team started adding a complexity label when making new pull requests. In general, the feedback has been great! This approach encourages us to think about how complex the changes are when we add new code to Android Microsoft To Do app.&lt;/p&gt;

&lt;p&gt;The benefits of this approach so far include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telling at glance how much time it might take to review the changes. This helps to plan which pull requests might need a longer time to review and what can be quickly reviewed in the spare 10 minutes between other tasks.&lt;/li&gt;
&lt;li&gt;Thinking about complexity when creating pull requests and strategies to mitigate risk.&lt;/li&gt;
&lt;li&gt;The pull request list becomes more manageable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We did not experience any big issues, but a few things we discovered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is hard to get used to any new approach, so remembering to add a label is not automatic yet.&lt;/li&gt;
&lt;li&gt;Our release notes made use of pull request titles for the draft version, so we had to add an additional script to strip the labels out as part of our continuous integration process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a closing thought, I would encourage you to be forgiving about the labels. They are rough indicators intended to help with the process. If you are getting lost in conversations over whether a pull request is XL or XXL, you are missing the point! 😀&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>codequality</category>
      <category>pullrequest</category>
      <category>codereviews</category>
    </item>
    <item>
      <title>Android Accessibility - Where to start?</title>
      <dc:creator>Sigute</dc:creator>
      <pubDate>Tue, 11 Feb 2020 20:11:52 +0000</pubDate>
      <link>https://dev.to/sigute/android-accessibility-where-to-start-40ce</link>
      <guid>https://dev.to/sigute/android-accessibility-where-to-start-40ce</guid>
      <description>&lt;p&gt;Making sure as many people as possible can use an app you are developing is so important for many of us. If you are just starting to think about accessibility in your Android app, it can be hard to understand what the requirements are and how to get started. This article will allow you to start exploring common accessibility issues in Android apps; making these small improvements will help many users of your app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools
&lt;/h2&gt;

&lt;p&gt;The main tools used for Android accessibility testing are offered by Google and many come pre-installed on every device. The main ones you need to start with are:&lt;/p&gt;

&lt;h3&gt;
  
  
  Talkback
&lt;/h3&gt;

&lt;p&gt;Most devices have either &lt;a href="https://support.google.com/accessibility/android/answer/6283677?hl=en"&gt;Talkback&lt;/a&gt; or a similar screen reader already pre-installed. Once enabled, a tutorial is provided so you can learn how to navigate. With Talkback, captions can be enabled in the settings and are helpful to verify the announcements, and if you need to take a screenshot to share with other members of the team this is a useful feature.&lt;/p&gt;

&lt;p&gt;Enable Talkback and captions:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Settings -&amp;gt; Accessibility -&amp;gt; Talkback -&amp;gt; Settings -&amp;gt; Developer Settings -&amp;gt; Display speech output&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility Scanner
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.auditor"&gt;Accessibility Scanner&lt;/a&gt; is a tool made by Google specifically for finding common accessibility issues and is very easy to use. It can be downloaded and installed from the Play store. Once installed, any screen in any app can be scanned for issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contrast checker
&lt;/h3&gt;

&lt;p&gt;After finding issues, sometimes tweaking colours is enough to resolve them. There are many contrast checkers available, I like the &lt;a href="https://webaim.org/resources/contrastchecker/"&gt;WebAIM&lt;/a&gt; one as it checks both text and other elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 places to start
&lt;/h2&gt;

&lt;p&gt;My advice is to start with these areas to address the most common issues found in many apps. When we think about accessibility in apps, we often think about vision impairments, including vision loss. Another area to think about is mobility impairments which can make it difficult to use controls and navigation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Labels and content descriptions
&lt;/h3&gt;

&lt;p&gt;Launch Talkback and start checking what announcements are made as you focus on various views in the app. Some questions to keep in mind while testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do buttons have labels?&lt;/li&gt;
&lt;li&gt;Do images have content descriptions?&lt;/li&gt;
&lt;li&gt;Do labels match what is actually shown on the screen?&lt;/li&gt;
&lt;li&gt;When the element state changes, is the content description updated? (for example, ticked and unticked radio button)&lt;/li&gt;
&lt;li&gt;Are there some elements which are only decorative and should not be announced?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fixing issues in this category is usually straightforward. Content description can be added and updated. Decorative elements can be labelled as not important for accessibility and will be skipped. Android Lint provides some warnings for missing accessibility features, and addressing these will help.&lt;/p&gt;

&lt;p&gt;The aforementioned Accessibility Scanner will catch a lot of these issues too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigation
&lt;/h3&gt;

&lt;p&gt;Talkback is the tool to use for this category. Keyboard navigation follows similar paths, so it could be used for testing as well. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As you navigate through the app, does focus jump around or is the order followed logical?&lt;/li&gt;
&lt;li&gt;Do you lose focus and need to start at the top of the page again?&lt;/li&gt;
&lt;li&gt;Can all areas be accessed without tapping on the screen directly?&lt;/li&gt;
&lt;li&gt;Does Talkback focus on each element separately or can some elements be grouped? (for example, user name could be navigated as "Name", "Surname" or as one "Name Surname" element)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fixing navigation can be challenging, so deciding on the strategy early rather than trying to retrofit the solution later is often the best approach. Some things to look into for this category include the accessibility traversal order, setting content descriptions on groups rather than individual items and requesting focus manually on specific elements in some scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Font sizes
&lt;/h3&gt;

&lt;p&gt;Changing font to a larger size in device settings will help to check for issues in this area. Display size can be changed as well and should be tested. Things to look for include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does all the text in the app respond to device setting font size?&lt;/li&gt;
&lt;li&gt;Do any elements overlap each other?&lt;/li&gt;
&lt;li&gt;Is any text cut off and cannot be read anymore?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix issues in this area, look for any usages of &lt;code&gt;dp&lt;/code&gt; instead of &lt;code&gt;sp&lt;/code&gt; for text sizing. Make sure elements scale to match the text sizes and prefer scrollable screens which can accommodate additional height if needed. For the individual views, it is best to avoid fixed height and width. Setting the view height and width to &lt;code&gt;wrap_content&lt;/code&gt; and using &lt;code&gt;minWidth&lt;/code&gt; and &lt;code&gt;minHeight&lt;/code&gt; attributes will help with the scaling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contrast
&lt;/h3&gt;

&lt;p&gt;Contrast can be checked using Accessibility Scanner and other contrast checker tools. It might be hard to determine contrast ratio just by looking. Some questions you might ask are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are any colours very similar to each other?&lt;/li&gt;
&lt;li&gt;Can tappable elements be easily distinguished?&lt;/li&gt;
&lt;li&gt;Is there a rule for what colours of background and text could be used in the app, to make the contrast ratio more predictable?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;General requirement is minimum &lt;code&gt;4.5:1&lt;/code&gt; contrast ratio of text to background, and &lt;code&gt;3:1&lt;/code&gt; for controls. Outlines can help to distinguish tappable elements in some cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tap target sizes
&lt;/h3&gt;

&lt;p&gt;If you ever tried tapping a button multiple times without success, you have ran into this issue. Accessibility Scanner will highlight the areas which are too small to tap accurately. Some things to keep in mind include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is there enough padding to tappable elements?&lt;/li&gt;
&lt;li&gt;Are there a lot of small elements right next to each other, so it's easy to mis-tap?&lt;/li&gt;
&lt;li&gt;Can the entire element be tapped or is the tap area limited to a small portion of it?&lt;/li&gt;
&lt;li&gt;Can the tap area be expanded?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Android recommendation is a minimum &lt;code&gt;48x48dp&lt;/code&gt; for tappable areas. Some margins between elements, where possible, can also make for a nicer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch out for…
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Custom views
&lt;/h3&gt;

&lt;p&gt;If you define your own custom views, be careful. Default Android framework elements come with a lot of built-in accessibility support. Where possible, extending the framework class, like &lt;code&gt;Button&lt;/code&gt;, might help to reduce some work vs extending a more generic class, such as &lt;code&gt;FrameLayout&lt;/code&gt;, and having to build various states and announcements from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continue with…
&lt;/h2&gt;

&lt;p&gt;Checking for these common issues will help to improve accessibility in your app. However, there are more things to consider to provide a great experience for users with accessibility needs. &lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;WCAG guidelines&lt;/a&gt; are a great place to go for understanding additional requirements and exploring common solutions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was first published on Android@Microsoft Medium publication &lt;a href="https://medium.com/android-microsoft/android-accessibility-where-to-start-b7875045d9"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>android</category>
      <category>devtips</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
