Success Criterion 2.4.7 - Level AA
Ensure that elements focused by assistive technologies are clearly indicated. Focus is often shown by placing a box around the element. Make sure that the placement is correct and that the colour is clearly visible. For apps it is not possible to adjust the colour of the frame. However, it is possible to give elements a different background colour when they have focus.
Apps become more usable when the element with focus is clearly visible.
“Is the focus clearly shown everywhere when navigating with assistive technologies?“
Note: apps cannot adjust the colour of the focus frame. This can only be done by the user through the system settings.
On Android, you can adjust colors when an element receives focus. However, it's not possible to change the focus indicator of assistive technologies. Users can adjust their preferences in the system settings of Android.
The code sample below shows how to change the background color of a button on focus.
<!-- selector.xml --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/focused" android:state_focused="true" /> <item android:drawable="@color/default" /> </selector> <!-- layout.xml --> <Button android:id="@+id/button" android:background="@drawable/selector"> </Button>