# Android XML Views

> Standards for ViewBinding, RecyclerView, and XML Layouts

- Skill: `majiayu000/android-xml-views` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/android-xml-views`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/android-xml-views/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/android-xml-views

---


# Android XML Views Standards

## **Priority: P1**

## Implementation Guidelines

### ViewBinding

- **Standard**: Use ViewBinding for all XML layouts.
- **Synthetics**: `kotlin-android-extensions` is Dead. Remove it.
- **KAPT**: Avoid DataBinding unless strictly necessary (impacts build speed).

### RecyclerView

- **Adapter**: Always inherit `ListAdapter` (wraps AsyncListDiffer).
- **Updates**: Provide a proper `DiffUtil.ItemCallback`. NEVER call `notifyDataSetChanged()`.

### Layouts

- **ConstraintLayout**: Use for complex flat hierarchies.
- **Performance**: Avoid deep nesting (LinearLayout inside LinearLayout).

## Anti-Patterns

- **findViewById**: `**Deprecated**: Use ViewBinding.`
- **Synthetics**: `**Deprecated**: Remove import kotlinx.android.synthetic.*.`

## References

- [ViewBinding & Adapter](references/implementation.md)

