Compose में पांच क्विक ऐनिमेशन
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इन पांच आसान और तेज़ ऐनिमेशन की मदद से, अपने ऐप्लिकेशन को कुछ ही मिनटों में शानदार बनाया जा सकता है. ऐनिमेशन के बारे में पूरी जानकारी हासिल किए बिना भी, अपने Compose ऐप्लिकेशन को बेहतर बनाएं.
प्रमुख बिंदु
- दिखने वाली स्थितियों में होने वाले बदलावों को
AnimatedVisibility
कॉम्पोज़ेबल में रैप करें, ताकि स्क्रीन पर स्थितियों में होने वाले बदलावों को दिखाने का तरीका बदला जा सके.
- एक से दूसरी स्थिति में आसानी से ट्रांज़िशन करने के लिए, पहले से मौजूद मॉडिफ़ायर का इस्तेमाल करें
animateContentSize
.
- टारगेट की दी गई स्थितियों के आधार पर कॉन्टेंट स्विच करने के लिए,
when
कंडीशनल को AnimatedContent
कॉम्पोज़ेबल में रैप करें.
- जब आपके इनपुट वैरिएबल की स्थिति बदलती है, तो ऐनिमेशन दिखाने के लिए
animate*AsState
फ़ंक्शन का इस्तेमाल करें.
- समय के साथ वैरिएबल बदलने पर, 'लिखें' विकल्प, फिर से ड्रॉ करने की सुविधा को ट्रिगर करता है. इससे स्क्रीन पर ऐनिमेशन बनता है.
संसाधन
ऐसे संग्रह जिनमें यह गाइड शामिल है
यह गाइड, चुने गए क्विक गाइड के कलेक्शन का हिस्सा है. इसमें Android डेवलपमेंट के बड़े लक्ष्यों के बारे में बताया गया है:
इमेज दिखाएं
अपने Android ऐप्लिकेशन को शानदार लुक देने के लिए, चमकदार और दिलचस्प विज़ुअल इस्तेमाल करने की तकनीकें जानें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-02-06 (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-02-06 (UTC) को अपडेट किया गया."],[],[],null,["# Five quick animations in Compose\n\n\u003cbr /\u003e\n\nThese 5 quick and easy animations can help make your app come to life in just a\nfew minutes. Make your Compose app stand out even if you don't have the time to\nlearn everything there is to know about animations. \n\nKey points\n----------\n\n- Wrap changing visible states in an [`AnimatedVisibility`](/reference/kotlin/androidx/compose/animation/package-summary#(androidx.compose.animation.core.Transition).AnimatedVisibility(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.animation.EnterTransition,androidx.compose.animation.ExitTransition,kotlin.Function1)) composable to transform how state changes show on screen.\n- To smoothly transition between two states, use the built-in modifier [`animateContentSize`](/reference/kotlin/androidx/compose/animation/package-summary#(androidx.compose.ui.Modifier).animateContentSize(androidx.compose.animation.core.FiniteAnimationSpec,kotlin.Function2)).\n- Wrap a `when` conditional in an [`AnimatedContent`](/reference/kotlin/androidx/compose/animation/package-summary#AnimatedContent(kotlin.Any,androidx.compose.ui.Modifier,kotlin.Function1,androidx.compose.ui.Alignment,kotlin.String,kotlin.Function1,kotlin.Function2)) composable to switch content based on the provided target states.\n- Use [`animate*AsState`](/reference/kotlin/androidx/compose/animation/core/package-summary#animateDpAsState(androidx.compose.ui.unit.Dp,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)) functions to perform the animation when the state of your input variable changes.\n- Compose triggers a redraw as variables change over time, creating an animation on screen.\n\nResources\n---------\n\n- [Blog: Customizing AnimatedContent in Jetpack Compose](https://medium.com/androiddevelopers/customizing-animatedcontent-in-jetpack-compose-629c67b45894)\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 images\n\nDiscover techniques for using bright, engaging visuals to give your Android app a beautiful look and feel. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-images) \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)"]]