मुख्य सामग्री पर जाएँ
Skillpedia
मोबाइल ऐप10k · #11938

leanback-to-compose-tv-migration

यह क्या करती है

यह स्किल Android TV ऐप को Leanback UI टूलकिट, Views या support fragments से TV के लिए Jetpack Compose में माइग्रेट करने का मार्गदर्शन देती है। इसमें browse, settings, login और वीडियो प्लेबैक जैसी स्क्रीन शामिल हैं। यह उन Android TV डेवलपरों के लिए है जो अपने ऐप को आधुनिक बना रहे हैं।

कब इस्तेमाल करें

  • ✓जब आपके Android TV ऐप में Leanback है और आप उसे TV के लिए Jetpack Compose में ले जाना चाहते हैं।
  • ✓जब आपको TV की browse, settings या login स्क्रीन Compose में माइग्रेट करनी हो।
  • ✓जब आप चाहते हैं कि TV स्क्रीन कमरे की दूरी से देखने और रिमोट नेविगेशन के लिए बनें।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/android/skills/blob/main/tv/leanback-to-compose-tv-migration/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Android TV ऐप की browse स्क्रीन को Leanback से TV के लिए Jetpack Compose में माइग्रेट कीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल androidx.tv लाइब्रेरी के आर्किटेक्चर पैटर्न का पालन करती है, जिसमें बड़े और पढ़ने में आसान टेक्स्ट, उच्च कंट्रास्ट और D-pad नेविगेशन पर ध्यान रहता है। फिर वह hero backdrop और navigation drawer जैसे कस्टम लेआउट बनाती है।

तकनीकी सामग्री (मूल 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-foot UI का क्या मतलब है?

यह TV के लिए डिज़ाइन का तरीका है, जिसे लगभग 3 मीटर की दूरी से देखा जाता है, इसलिए इसमें बड़े टेक्स्ट और सरल नेविगेशन होते हैं।

यह कौन सी लाइब्रेरी इस्तेमाल करती है?

यह 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
अपडेट की गई
29/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

agp-9-upgrade

10k

आपके एजेंट को Android ऐप को Android Gradle Plugin 9 पर ले जाने और उसके breaking changes सुधारने में मदद करती है। मल्टीप्लेटफ़ॉर्म प्रोजेक्ट के लिए नहीं।

कोडिंगमोबाइल ऐप

camerax

10k

आपके एजेंट को CameraX से Android कैमरा फ़ीचर बनाने में मदद करती है, जिसमें वीडियो रिकॉर्डिंग, हार्डवेयर कंट्रोल, ML Kit और Media3 इफ़ेक्ट शामिल हैं।

कोडिंगमोबाइल ऐप

android-for-cars-parked-apps

10k

आपके एजेंट को Android वीडियो, गेम या ब्राउज़र ऐप को Android Auto और Android Automotive पर parked ऐप के रूप में चलाने के लिए ढालने में मदद करती है।

कोडिंगमोबाइल ऐप

appfunctions

10k

आपके एजेंट को Android ऐप के मुख्य काम ढूँढकर उन्हें AppFunctions के रूप में देने में मदद करती है, ताकि AI एजेंट और वॉइस कमांड उन्हें चला सकें।

AI और एजेंटएजेंट

मिलती-जुलती skills