Jetpack Compose RC01 中缺少 AnimatedImageVector
AnimatedImageVector missing in Jetpack Compose RC01
AnimatedImageVector
不再出现在 Jetpack Compose 1.0.0-rc01 中
还缺少函数 animatedVectorResource
。
如何替换它们?
如您在 release notes 中所读:
AnimatedImageVector was temporarily removed in order to change the module structure
更新:
从1.1.0-alpha01
开始,"AnimatedImageVector 和相关的API 都在新的
androidx.compose.animation:animation-graphics
模块。 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
}
)
AnimatedImageVector
不再出现在 Jetpack Compose 1.0.0-rc01 中
还缺少函数 animatedVectorResource
。
如何替换它们?
如您在 release notes 中所读:
AnimatedImageVector was temporarily removed in order to change the module structure
更新:
从1.1.0-alpha01
开始,"AnimatedImageVector 和相关的API 都在新的
androidx.compose.animation:animation-graphics
模块。 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
}
)