leanback-to-compose-tv-migration
What it does
This skill guides migrating Android TV apps from the Leanback UI toolkit, Views or support fragments to Jetpack Compose for TV. It covers screens like browse, settings, login and video playback. It is for Android TV developers modernizing their apps.
When to use it
- ✓When your Android TV app uses Leanback and you want to move it to Jetpack Compose for TV.
- ✓When you need to migrate a TV browse, settings or login screen to Compose.
- ✓When you want TV screens designed for viewing from across the room with remote control navigation.
Skill link
https://github.com/android/skills/blob/main/tv/leanback-to-compose-tv-migration/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Migrate the browse screen of my Android TV app from Leanback to Jetpack Compose for TV.”
5 new skills a week. 1 minute to read.
How it works
The skill follows architecture patterns for the androidx.tv libraries, focusing on large readable text, high contrast and D-pad navigation. It then builds custom layouts such as hero backdrops and navigation drawers.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
The 10-foot UI
A "10-foot UI" is a design paradigm for televisions that tailors an interface for viewing from approximately 3 meters (10 feet) away. When designing for this experience, account for these key characteristics:
- Viewing distance: Viewers are sitting far from the screen, "leaning back". Screen layouts are uncluttered, with text and UI elements that are large enough to be comfortably readable from a distance, without dense blocks of text.
- Color contrast: To avoid washed out colors on TV displays with low contrast ratios, the design uses high-contrast palettes and distinct visual indicators so focused states remain visible across different TV panels.
- D-pad navigation : Interaction relies on a directional remote control with limited 4-way navigation (
Up,Down,Left,Right) with components organized into clear spatial grids and carousels without focus traps.
Core architecture and library selection
When migrating an Android TV application to Jetpack Compose, you must use
androidx.tv libraries and follow these 10-foot UI patterns:
- UI modernization: Focus on custom, cinematic layouts over legacy direct 1:1 templates. You must use Jetpack Compose for TV features like dynamic gradient hero backdrops, custom focus animations, custom navigation drawers, and custom layouts.
- Primary design system : You must always use
androidx.tv.material3.*(androidx.tv:tv-material) over mobileandroidx.compose.material3.*. TV Material 3 provides built-in D-Pad focus handling, focus zoom scaling, and TV-optimized typography and shapes. To set up Compose for TV dependencies, follow Compose for TV setup. - Focus zoom animation : For interactive cards, you must use
CompactCard,ClassicCard, orWideCardContainerwithscale = CardDefaults.scale(focusedScale = 1.1f)to provide standard TV focus animation. - Coil image loading : To use declarative
AsyncImage(model, contentDescription, ...)without passing an explicitImageLoaderparameter, you must includeio.coil-kt:coil-composein your Gradle dependencies. - Explicit imports : You must always import TV Material 3 classes explicitly (for example,
import androidx.tv.material3.Surface,import androidx.tv.material3.ListItem) instead of using wildcard imports (import androidx.tv.material3.*). - File naming conventions : You must name Composable screen files after the screen (for example, name
BrowseScreenasBrowseScreen.kt,PlaybackScreenasPlaybackScreen.kt, andAuthenticationScreenasAuthenticationScreen.kt). Don't use generic prefixes likeMain. - Overscan and bezels : You must apply horizontal padding (for example,
horizontal = 48.dpor32.dp,vertical = 24.dp) to root containers, carousels, and top bars to prevent clipping. - Reading width constrainment : You must constrain reading width using
Modifier.widthIn(max = 600.dp)on text columns for long-form text. - Media3 Compose dependencies : Include
androidx.media3:media3-ui-composeinapp/build.gradlewhen modernizing media playback screens. - Prohibition of legacy AndroidView wrappers : Don't use legacy
AndroidViewwrappers to embed View-based components into Jetpack Compose screens. All migrated screens must use Compose components or Media3 Compose surfaces (PlayerSurface).
D-pad focus handling and navigation
Jetpack Compose for TV (androidx.tv.material3) requires explicit focus
management, as components don't receive initial focus automatically and
navigation uses 2D spatial coordinates. To configure TV D-pad navigation, follow
instructions in TV Navigation guide.
Initial focus
You must assign initial focus to the primary interactive element on every screen
(such as the first action button, card, or ListItem) using FocusRequester
when entering a screen. Define val focusRequester = remember { FocusRequester() }, attach Modifier.focusRequester(focusRequester) to the primary element, and
request focus inside LaunchedEffect(Unit) { focusRequester.requestFocus() }:
val focusRequester = remember { FocusRequester() }
val focusManager = LocalFocusManager.current
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
<br />
*Note: For screens with dynamic state or pagers (like OnboardingScreen using
HorizontalPager), you must pass
FAQ
Does it copy the old Leanback layouts exactly?
No. It favors custom, cinematic layouts over direct one-to-one copies of the old templates.
What does the 10-foot UI mean?
It is a design approach for TVs viewed from about 3 meters away, with large text and simple navigation.
Which libraries does it use?
It uses the androidx.tv libraries of Jetpack Compose for TV.
Details
Original description by the author
Provides instructions and architectural patterns for migrating Android TV applications from legacy Leanback UI Toolkit, Android Views, or Support Fragments to Jetpack Compose for TV (androidx.tv). Use this skill for Leanback to Compose migrations, including browse screen, settings screen, authentication screen, login screen, or video playback screen migrations, or when replacing BrowseSupportFragment, LeanbackSettingsFragment, PreferenceFragment, BaseLeanbackPreferenceFragmentCompat, VideoSupportFragment, GuidedStepSupportFragment, SearchSupportFragment, VerticalGridSupportFragment, Presenter,
repo: android/skills
Popularity
- GitHub stars
- 10k
- Ranking position
- #11938
- License
- Apache-2.0
- Updated
- 10/29/2026
Comments
- …
More skills from this repository
agp-9-upgrade
10kHelps your agent upgrade an Android app to Android Gradle Plugin 9 and work through its breaking changes. Not for multiplatform projects.
camerax
10kHelps your agent build Android camera features with CameraX, including video recording, hardware controls, ML Kit and Media3 effects.
android-for-cars-parked-apps
10kHelps your agent adapt an Android video, game or browser app to run as a parked app on Android Auto and Android Automotive.
appfunctions
10kHelps your agent find key workflows in an Android app and expose them as AppFunctions that AI agents and voice commands can run.
Similar skills
android-clean-architecture
280kMakes your agent organize Android projects efficiently. It structures the code to make maintenance and new feature development easier.
compose-multiplatform-patterns
280kHelps your agent use Compose Multiplatform and Jetpack Compose patterns in KMP projects, covering state, navigation, theming, and performance.
dart-flutter-patterns
280kMakes your agent write code for Dart and Flutter apps. It uses modern patterns to create robust and manageable apps.