Small Touch Target Size

Id SmallTouchTargetSize
Summary Targets are smaller than recommended guidelines, reducing tap accuracy
Severity Warning
Category Touch Interaction
Affects Resource files and Kotlin and Java files
Implementation Custom lint rule – checks declared size of clickable views in static code to flag touch targets smaller than recommended minimum (e.g., 48dp)

Symptom

Interactive elements like buttons, links, and controls are difficult to tap accurately, requiring multiple attempts or precise finger placement to activate successfully.

Rationale

Small touch targets are hard to activate accurately, especially for users with larger fingers or limited dexterity. This increases the chance of errors and can make the interface frustrating or unusable.

Examples

XML Layout Example

<!-- Button too small for accessible touch target -->
<Button
    android:id="@+id/close_button"
    android:layout_width="24dp"
    android:layout_height="24dp"
    android:text="X" />

Kotlin Code Example

class MainActivity : AppCompatActivity() {

    private fun createSmallButton() {
        val button = Button(this)
        button.layoutParams = ViewGroup.LayoutParams(
            24.dpToPx(), // Too small
            24.dpToPx()  // Too small
        )
    }
}

GitHub issues under this tag