5

AnimatedImageVector is no more present in Jetpack Compose 1.0.0-rc01 Also function animatedVectorResource is missing.

How to replace them?

Solvek
  • 5,158
  • 5
  • 41
  • 64
  • It is so annoying to google where to find the required class. This question is still valid. They should update their docs while releasing new updates even minor – NightFury Sep 23 '21 at 16:03

1 Answers1

8

As you can read in the release notes:

enter image description here

AnimatedImageVector was temporarily removed in order to change the module structure

UPDATE:
Starting from 1.1.0-alpha01, "AnimatedImageVector and the related APIs are now in the new androidx.compose.animation:animation-graphics module. More detail in this commit.

    val image = animatedVectorResource(drawableId)
    var atEnd by remember { mutableStateOf(false) }
    Image(
        painter = image.painterFor(atEnd),
        contentDescription = "Your content description",
        modifier = Modifier.size(64.dp).clickable {
            atEnd = !atEnd
        }
    )
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841