compose-focus-navigation

Provide focus navigation guidelines for Jetpack Compose applications.

13|Updated Jun 24, 2021
One-click install
npx skills add https://github.com/costular/Minitask --skill compose-focus-navigation-costular
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-focus-navigation
Source: https://github.com/costular/Minitask/tree/main/.agents/skills/compose-focus-navigation
Command: npx skills add https://github.com/costular/Minitask --skill compose-focus-navigation-costular

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides guidelines and best practices for focus navigation in Jetpack Compose UI, helping developers build accessible and user-friendly interfaces.

Core Features & Use Cases

  • Focus Navigation: Improve focus traversal and accessibility in Jetpack Compose applications.
  • Focus Requester: Utilize FocusRequester for managing focus requests.
  • Focus Properties: Customize focus properties and key handlers.
  • Use Case: Design an application that supports keyboard, D-pad, or remote key navigation on TV or desktop devices.

Quick Start

Run the skill to review the guidelines for focus navigation in Jetpack Compose UI.

Frequently Asked Questions about compose-focus-navigation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle focus navigation in Jetpack Compose for TV and desktop applications?

Focus navigation in Jetpack Compose requires using FocusRequester to manage focus traversal and customizing focus properties to support D-pad, remote control, and keyboard inputs for TV and desktop interfaces.

What is the best way to manage focus requests in a Jetpack Compose UI?

The best way to manage focus requests in Jetpack Compose is by utilizing FocusRequester, which allows developers to programmatically direct focus to specific composables and customize focus properties for improved accessibility.

How do I handle key events for remote control navigation in Jetpack Compose?

Handling key events for remote control navigation in Jetpack Compose involves customizing focus properties and key handlers within your composables to intercept and respond to D-pad or remote control input interactions.

Can I restore focus to a specific element after navigation in Jetpack Compose?

Yes, you can restore focus in Jetpack Compose by applying focus restoration guidelines and utilizing FocusRequester to save the focus state and redirect focus back to the intended element after navigation occurs.

Why does focus traversal fail when using a D-pad in my Compose TV application?

Focus traversal fails with D-pad input in Compose TV applications when focus properties are not properly configured, requiring you to implement specific key event handling and FocusRequester guidelines to ensure correct directional navigation.

Do I need specific dependencies to improve accessibility in Jetpack Compose UI?

No specific dependencies are required to improve accessibility in Jetpack Compose UI, as the framework provides built-in focus properties, FocusRequester APIs, and key event handling mechanisms to support accessible navigation natively.