Compose में लेज़ी लिस्ट
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Compose की मदद से, स्क्रोल करने वाली सूचियां आसानी से और बेहतर तरीके से बनाई जा सकती हैं. इसके लिए, RecyclerView
की तुलना में कम कोड लाइन का इस्तेमाल किया जाता है. ऐसी सूचियां बनाने के लिए, लैज़ी लेआउट का इस्तेमाल करने का तरीका जानें जिनमें मांग के हिसाब से कॉन्टेंट जोड़ा जा सकता है.
प्रमुख बिंदु
- ज़्यादा आइटम या बड़े डेटासेट के लिए, मांग पर कॉन्टेंट जोड़ने के लिए लेज़ी लेआउट का इस्तेमाल करें. इससे आपके ऐप्लिकेशन की परफ़ॉर्मेंस और रिस्पॉन्सिवनेस बेहतर होगी.
- इस तरीके से, आइटम के कॉन्टेंट के बारे में बताने पर फ़ोकस किया जा सकता है. वहीं, लेज़ी सूचियां बाकी सभी कामों को मैनेज करती हैं.
item()
ब्लॉक का इस्तेमाल करके, एक आइटम के बारे में बताया जा सकता है. इसके अलावा, items()
ब्लॉक का इस्तेमाल करके, एक से ज़्यादा आइटम के बारे में बताया जा सकता है.
LazyListState
एक अहम स्टेटस ऑब्जेक्ट है, जो स्क्रोल की पोज़िशन सेव करता है. साथ ही, इसमें आपकी सूची के बारे में काम की जानकारी होती है.
संसाधन
ऐसे संग्रह जिनमें यह गाइड शामिल है
यह गाइड, चुने गए क्विक गाइड के कलेक्शन का हिस्सा है. इसमें Android डेवलपमेंट के बड़े लक्ष्यों के बारे में बताया गया है:
सूची या ग्रिड दिखाना
सूचियों और ग्रिड की मदद से, आपके ऐप्लिकेशन में संग्रहों को ऐसे दिखाया जा सकता है कि वे उपयोगकर्ताओं को देखने में अच्छे लगें और उन्हें आसानी से समझ आएं.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# Lazy lists in Compose\n\n\u003cbr /\u003e\n\nCompose gives you a simpler and more performant way to create scrolling lists,\nusing fewer lines of code than [`RecyclerView`](/reference/androidx/recyclerview/widget/RecyclerView). Learn how to use lazy\nlayouts to create lists that let you add content to lists, on demand. \n\nKey points\n----------\n\n- Use lazy layouts to add content on demand for a significant number of items or large datasets, increasing your app's performance and responsiveness.\n- This approach lets you focus on describing your item content while lazy lists handle everything else.\n- You can describe one item using the [`item()`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListScope#item(kotlin.Any,kotlin.Any,kotlin.Function1)) block or multiple items with the [`items()`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function2)) block.\n- [`LazyListState`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListState) is an important state object that stores the scroll position and contains useful information on your list.\n\nResources\n---------\n\n- [Codelab: Basic layouts in Compose](/codelabs/jetpack-compose-layouts#0)\n\nCollections that contain this guide\n-----------------------------------\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\n### Display a list or grid\n\nLists and grids allow your app to display collections in a visually pleasing form that's easy for users to consume. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-a-list-or-grid) \n\nHave questions or feedback\n--------------------------\n\nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]