[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Choose an animation API\n\nThe 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)."]]