Incorrect State Exposure to Assistive Tools

Id IncorrectStateExposuretoAssistiveTools
Summary States (e.g., checked, selected) are not updated or announced properly
Severity N/A
Category Assistive Technologies / Semantic Roles and States
Affects Resource files and Kotlin and Java files
Implementation Manual testing - Determining whether an element should be interactive requires understanding its semantic purpose and design intent, which cannot be reliably inferred from code structure alone. Manual testing is needed to verify correct interaction announcements.

Symptom

UI elements have incorrect interactive state configuration where the accessibility properties (android:clickable, android:focusable, click listeners) don't match the element's actual behavior, causing screen readers to announce incorrect interaction possibilities or miss available functionality.

Rationale

Creates confusion and inefficient navigation for assistive technology users who either attempt to interact with non-functional elements or miss actionable content, leading to frustration, wasted effort, and potential inability to complete intended tasks.

Examples

XML Layout Example

<!-- Chart bar marked as clickable but is only for data visualization -->
<View
    android:id="@+id/traffic_bar"
    android:layout_width="40dp"
    android:layout_height="120dp"
    android:background="@color/chart_blue"
    android:clickable="true"
    android:focusable="true" />
    <!-- Element is decorative/informational, not interactive -->
    <!-- TalkBack announces "Double tap to activate" but nothing happens -->
    <!-- Should be: android:clickable="false" or remove clickable/focusable attributes -->

Kotlin Code Example

class FileListActivity : AppCompatActivity() {

    private fun setupFileListItem() {
        val listItem = findViewById<View>(R.id.file_list_item)

        // List item marked as long-clickable but doesn't support long-press
        listItem.isLongClickable = true
        // TalkBack announces "Double tap and hold to long press" but no action exists
        // This creates false expectations for users

        // Correct approach:
        // listItem.isLongClickable = false
        // Or add the missing long-click functionality:
        // listItem.setOnLongClickListener { showContextMenu(); true }
    }
}

GitHub issues under this tag