본문으로 건너뛰기
Skillpedia
모바일 앱10k · #11938

leanback-to-compose-tv-migration

하는 일

이 스킬은 Android TV 앱을 Leanback UI 툴킷, Views 또는 support fragment에서 TV용 Jetpack Compose로 옮기는 방법을 안내합니다. 탐색, 설정, 로그인, 동영상 재생 같은 화면을 다룹니다. Android TV 앱을 현대화하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Android TV 앱이 Leanback을 쓰고 있고 이를 TV용 Jetpack Compose로 옮기고 싶을 때.
  • ✓TV의 탐색, 설정, 로그인 화면을 Compose로 옮겨야 할 때.
  • ✓리모컨으로 탐색하고 거실에서 멀리서 보아도 잘 보이는 TV 화면을 원할 때.

스킬 링크

https://github.com/android/skills/blob/main/tv/leanback-to-compose-tv-migration/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/android/skills/blob/main/tv/leanback-to-compose-tv-migration/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 Android TV 앱의 탐색 화면을 Leanback에서 TV용 Jetpack Compose로 옮겨 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 androidx.tv 라이브러리의 아키텍처 패턴을 따르며, 큰 글씨, 높은 대비, D-pad 탐색에 중점을 둡니다. 그다음 히어로 배경 화면과 내비게이션 드로어 같은 맞춤 레이아웃을 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 mobile androidx.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, or WideCardContainer with scale = CardDefaults.scale(focusedScale = 1.1f) to provide standard TV focus animation.
  • Coil image loading : To use declarative AsyncImage(model, contentDescription, ...) without passing an explicit ImageLoader parameter, you must include io.coil-kt:coil-compose in 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 BrowseScreen as BrowseScreen.kt, PlaybackScreen as PlaybackScreen.kt, and AuthenticationScreen as AuthenticationScreen.kt). Don't use generic prefixes like Main.
  • Overscan and bezels : You must apply horizontal padding (for example, horizontal = 48.dp or 32.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-compose in app/build.gradle when modernizing media playback screens.
  • Prohibition of legacy AndroidView wrappers : Don't use legacy AndroidView wrappers 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

자주 묻는 질문

예전 Leanback 레이아웃을 그대로 복사하나요?

아니요. 기존 템플릿을 그대로 옮기기보다 맞춤형 영화 같은 레이아웃을 선호합니다.

10피트 UI는 무엇을 뜻하나요?

약 3미터 떨어진 곳에서 TV를 보는 것을 전제로 한 디자인 방식으로, 큰 글씨와 단순한 탐색을 사용합니다.

어떤 라이브러리를 사용하나요?

Jetpack Compose for TV의 androidx.tv 라이브러리를 사용합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
10k
순위
#11938
라이선스
Apache-2.0
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬