| Id | NonFocusableInteractiveControl |
| Summary | Interactive controls cannot receive focus using keyboard or switch input, blocking access |
| Severity | Warning |
| Category | Assistive Technologies / Focus and Navigation |
| Affects | Resource files and Kotlin and Java files |
| Implementation | Fully covered by KeyboardInaccessibleWidget Android Lint rule |
Interactive UI elements that should be focusable lack explicit
android:focusable="true" or have improper
importantForAccessibility="no" attribute.
May prevent assistive technologies from properly accessing interactive elements, especially in complex layouts or custom components.
<!-- Clickable TextView without focusable attribute -->
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="Tap to expand details"
android:clickable="true"
android:background="?android:attr/selectableItemBackground" />
<!-- Missing: android:focusable="true" -->
<!-- Switch navigation cannot reach this element -->
class ProductListActivity : AppCompatActivity() {
private fun setupExpandableItem() {
val expandText = TextView(this).apply {
text = "Tap to expand details"
isClickable = true
setOnClickListener { expandDetails() }
// Missing: isFocusable = true
}
// Switch navigation and keyboard users cannot reach this element
// Only touch users can interact with it
}
}