| name | ui-refactor |
| description | Trigger: Legacy View Migration. Refactoring legacy Android views to View Binding, migrating XML layouts, and enforcing Leanback TV UI standards. |
| compatibility | gemini-1.5-pro, claude-3.5-sonnet |
| metadata | {"version":"1.0.0"} |
Skill: UI Refactor (Leanback & View Binding)
Purpose
This skill provides deep expertise in migrating legacy Android layouts to View Binding and ensuring compliance with the project's Leanback/TV UI standards.
Guidelines & Constraints
- View Binding: All
findViewById calls must be removed.
- Null Safety: Use
_binding and binding pattern in Fragments to avoid leaks.
- Leanback: Ensure focus effects are present for all interactive elements.
- Naming: IDs must be
snake_case.
Trigger Logic
- Activated when the user requests a UI refactor, View Binding migration, or new TV screen implementation.
Instructions
- Analyze Layout: Identify all IDs and nested includes.
- Generate Binding: Use the generated binding class for the layout.
- Migration: Replace manual view lookups with binding references.
- Verification: Confirm focus behavior in D-pad navigation.
References
prompts/agents/ui-standards.md
prompts/agents/architecture.md