خمس صور متحركة سريعة في ميزة "الكتابة الذكية"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكن أن تساعدك هذه الصور المتحركة الخمس السريعة والسهلة في إضفاء الحيوية على تطبيقك في
بضع دقائق فقط. يمكنك إبراز تطبيق "الكتابة" حتى إذا لم يكن لديك الوقت لاطلاعك على كل المعلومات اللازمة حول الرسوم المتحرّكة.
النقاط الرئيسية
- يمكنك تضمين حالات العرض المتغيّرة في عنصر
AnimatedVisibility
قابل للتركيب بهدف
تغيير طريقة عرض تغييرات الحالة على الشاشة.
- للانتقال بسلاسة بين حالتَين، استخدِم المُعدِّل المضمّن
animateContentSize
.
- لتغيير
المحتوى استنادًا إلى حالات الاستهداف المقدَّمة، يمكنك تضمين شرط
when
في عنصر قابل للتجميع من النوع AnimatedContent
.
- استخدِم دوال
animate*AsState
لتنفيذ التأثير المتحرك عند تغيُّر حالة
متغيّر الإدخال.
- يؤدي إنشاء الرسم إلى إعادة رسمه عندما تتغيّر المتغيّرات بمرور الوقت، ما يؤدي إلى إنشاء
صورة متحركة على الشاشة.
المراجع
المجموعات التي تتضمّن هذا الدليل
هذا الدليل هو جزء من مجموعات الأدلة السريعة المنظَّمة التي تتناول
أهداف تطوير Android الأوسع نطاقًا:
عرض الصور
تعرَّف على أساليب استخدام مرئيات مشرقة وجذابة لمنح تطبيق Android مظهرًا وشعورًا جميلَين.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-02-06 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)"]]