我有一个惰性列表,单击按钮时我将动画滚动到项目。
onClick = {
scope.launch {
lazyListState.animateScrollToItem(selectedIndex)
}
}
Run Code Online (Sandbox Code Playgroud)
为什么 animateScrollToItem 这么快?我可以放慢一点吗?我没有看到任何地方可以添加animationSpec,并且使用 animateScrollBy() 我需要传递一个浮点而不是索引 - 这是我不想要的。
android android-layout kotlin android-studio android-jetpack-compose
我正在阅读一些 Android 11 更新文档,显然需要实施 APK 签名方案 v2。AAB 格式已经这样做了吗?
android apk android-studio android-app-signing android-app-bundle
我有 3 个动画,但最上面的一个先启动,然后是另外两个,如何让它们同时启动?我尝试将它们放在相同的协程作用域中,但仍然得到相同的结果。
LaunchedEffect(isItemInView) {
scope.launch {
coroutineScope {
launch { // Even without the scope.launch, coroutineScope, launch lines, same effect
bar1.animateTo(if (isItemInView) bar1EndLocation else bar1StartLocation)
bar2.animateTo(if (isItemInView) bar2EndSize else bar2StartSize)
bar3.animateTo(if (isItemInView) bar3EndSize else bar3StartSize)
}
}
}
}
Column{
Bar1(modifier = Modifier.offset(bar1.value.x.dp, bar1.value.y.dp)
Bar2(modifier = Modifier.size(bar2.value.width.dp, bar2.value.height.dp)
Bar3(modifier = Modifier.size(bar3.value.width.dp, bar3.value.height.dp)
}
Run Code Online (Sandbox Code Playgroud)
我在这里做错了什么吗?
android kotlin android-studio android-jetpack-compose jetpack-compose-animation