The following code may encounter issues when using AnimatedVisibility, as the animation is very uneven
维护者通常 1 天内回复
@riggaroo 已经在做这个了。
开始于 2024年8月14日。
评估
这个 Issue 还没有评估数据。
描述
@Preview
@Composable
fun AnimatedVisibilityCookbook() {
var visible1 by remember {
mutableStateOf(true)
}
var visible2 by remember {
mutableStateOf(true)
}
Row(
modifier = Modifier.padding(top = 20.dp).fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(6.dp)
) {
Button(
modifier = Modifier,
onClick = {
visible1 = !visible1
},
shape = RoundedCornerShape(6.dp),
colors = ButtonDefaults.buttonColors(containerColor = Color.White),
contentPadding = PaddingValues(horizontal = 8.dp)
) {
Text(
text = "text",
color = Color.Black,
textAlign = TextAlign.Center
)
}
AnimatedVisibility(
modifier = Modifier.weight(1f),
visible = visible1
) {
Button(
modifier = Modifier,
onClick = { },
shape = RoundedCornerShape(6.dp),
colors = ButtonDefaults.buttonColors(containerColor = Color.White),
contentPadding = PaddingValues(horizontal = 8.dp)
) {
Text(
text = "text1",
color = Color.Black,
textAlign = TextAlign.Center
)
}
}
AnimatedVisibility(
modifier = Modifier.weight(1f),
visible = visible2
) {
Button(
modifier = Modifier,
onClick = { },
shape = RoundedCornerShape(6.dp),
colors = ButtonDefaults.buttonColors(containerColor = Color.White),
contentPadding = PaddingValues(horizontal = 8.dp)
) {
Text(
text = "text2",
color = Color.Black,
textAlign = TextAlign.Center
)
}
}
}
}
- 主要语言
- Kotlin
- 星标
- 1.2k
- 派生
- 448
- 平均合并
- 4 天 22 小时
- 30 天内合并 PR
- 42
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
android/snippets 的其他 Issue
-
ListWithMultipleItemTypes.kt — Incorrect usage of items() lambda and contentType可能已有人在做 @nero002 于 192 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
android/snippets#863 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
android/snippets#1335 · 1 条评论 ·
维护者通常 1 天内回复
-
18 month未关闭
难度 3/5 半天 新手友好度 15/100
维护者通常 1 天内回复
-
backup未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
code-scan
难度 2/5 1-3 小时 新手友好度 74/100
ankidroid/Anki-Android#23806 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 86/100
thisisartman/Meguri#211 ·
维护者通常 1 天内回复
-
follow-up
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
open-telemetry/opentelemetry-android#2309 ·
维护者通常 1 天内回复
-
📦 expo-location Android contributor: external needs review sdk-58 severity: medium
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复