Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-08-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-27 UTC."],[],[],null,["The following diagram helps you decide what API to use to implement your animation.\n\n\n**Figure 1.** Decision tree describing how to choose the appropriate animation API.\n\n\u003cbr /\u003e\n\nUse the following decision tree to choose the most appropriate animation API for your use case:\n\n- Is your animation art-based (that is, SVGs or images)?\n - Yes: Does it use simple SVGs (that is, an icon with micro-animations)?\n - Yes: [`AnimatedVectorDrawable`](/develop/ui/compose/animation/avd).\n - No: Third-party animation framework, for example, [`Lottie`](https://airbnb.io/lottie/).\n - No: Does the animation need to repeat infinitely?\n - Yes: [`rememberInfiniteTransition`](/develop/ui/compose/animation/value-based#rememberinfinitetransition).\n - No: Are you animating a layout?\n - Yes: Are you switching between composables with different content?\n - Yes: Are you using Navigation-Compose?\n - Yes: [`composable()`](/reference/kotlin/androidx/navigation/compose/package-summary#(androidx.navigation.NavGraphBuilder).composable(kotlin.String,kotlin.collections.List,kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)) with `enterTransition` and `exitTransition` set.\n - No: [`AnimatedContent`](/develop/ui/compose/animation/composables-modifiers#animatedcontent), [`Crossfade`](/develop/ui/compose/animation/composables-modifiers#crossfade), or [`Pager`](/develop/ui/compose/layouts/pager).\n - No: Are you animating the appearance or disappearance of content?\n - Yes: [`AnimatedVisibility`](/develop/ui/compose/animation/composables-modifiers#animatedvisibility) or [`animateFloatAsState`](/develop/ui/compose/animation/value-based#animate-as-state) with `Modifier.alpha()`.\n - No: Are you animating a size change?\n - Yes: [`Modifier.animateContentSize`](/develop/ui/compose/animation/composables-modifiers#animatedContentSize).\n - No: Are you animating another layout property (for example, offset or padding)?\n - Yes: See \"Are the properties completely independent of each other?\".\n - No: Are you animating list items?\n - Yes: [`animateItem()`](/develop/ui/compose/lists#item-animations).\n - No: Are you animating multiple properties?\n - Yes: Are the properties completely independent of each other?\n - Yes: [`animate*AsState`](/develop/ui/compose/animation/value-based#animate-as-state). For Text, use [`TextMotion.Animated`](/reference/kotlin/androidx/compose/ui/text/style/TextMotion#Animated()).\n - No: Do they need to start at the same time?\n - Yes: [`updateTransition`](/develop/ui/compose/animation/value-based#updatetransition) with `AnimatedVisibility`, `animateFloat`, `animateInt`, etc.\n - No: [`Animatable`](/develop/ui/compose/animation/value-based#animatable) with `animateTo`, called with different timings using suspend functions.\n - No: Does the animation have predefined target values?\n - Yes: [`animate*AsState`](/develop/ui/compose/animation/value-based#animate-as-state). For Text, use `TextMotion.Animated`.\n - No: Is the animation gesture-driven and the single source of truth?\n - Yes: `Animatable` with `animateTo` / `snapTo`.\n - No: Is it a one-shot animation without state management?\n - Yes: [`AnimationState`](/reference/kotlin/androidx/compose/animation/core/AnimationState) or [`animate`](/reference/kotlin/androidx/compose/animation/core/package-summary#animate(kotlin.Float,kotlin.Float,kotlin.Float,androidx.compose.animation.core.AnimationSpec,kotlin.Function2)).\n - No: Answer not here? [File a feature request](https://goo.gle/compose-feedback).\n\nDownload the [PDF version of the diagram](/static/develop/ui/compose/images/animations/compose_animation_decision_tree_v2.pdf)."]]