1.1
This commit is contained in:
parent
d2a3e61b54
commit
e2801b2a1d
@ -900,8 +900,8 @@ class MainActivity : ComponentActivity() {
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.reorderable(reorderableState),
|
||||
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||
contentPadding = PaddingValues(vertical = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(0.dp) // 移除间距,改为紧密列表
|
||||
) {
|
||||
itemsIndexed(reorderableAccounts, key = { _, account -> account.key }) { index, account ->
|
||||
// 为每个列表项添加错开的入场动画
|
||||
@ -917,34 +917,28 @@ class MainActivity : ComponentActivity() {
|
||||
) + fadeOut(animationSpec = tween(durationMillis = 200))
|
||||
) {
|
||||
ReorderableItem(reorderableState, key = account.key) { isDragging ->
|
||||
val elevation = animateDpAsState(
|
||||
targetValue = if (isDragging) 12.dp else 2.dp,
|
||||
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
||||
label = "elevation"
|
||||
)
|
||||
|
||||
// 拖拽时的缩放动画 - 与手环排序保持一致
|
||||
val dragScale by animateFloatAsState(
|
||||
targetValue = if (isDragging) 1.03f else 1f,
|
||||
targetValue = if (isDragging) 1.02f else 1f,
|
||||
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
||||
label = "drag_scale"
|
||||
)
|
||||
|
||||
Card(
|
||||
// 直接使用Box作为列表项容器,移除Card
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.graphicsLayer(
|
||||
scaleX = dragScale,
|
||||
scaleY = dragScale
|
||||
)
|
||||
.animateContentSize(),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = if (isDragging)
|
||||
MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
else
|
||||
MaterialTheme.colorScheme.surface
|
||||
)
|
||||
.background(
|
||||
if (isDragging)
|
||||
MaterialTheme.colorScheme.surfaceContainerHighest.copy(alpha = 0.5f)
|
||||
else
|
||||
MaterialTheme.colorScheme.surface
|
||||
)
|
||||
.animateContentSize()
|
||||
) {
|
||||
Row {
|
||||
// 拖拽排序模式下的账户卡片
|
||||
|
||||
@ -168,8 +168,7 @@ fun ModernTOTPCard(
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(80.dp)
|
||||
.padding(horizontal = 16.dp),
|
||||
.height(72.dp),
|
||||
horizontalArrangement = Arrangement.End,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
@ -233,12 +232,11 @@ fun ModernTOTPCard(
|
||||
}
|
||||
}
|
||||
|
||||
// 前景层:彻底修复圆角问题 - 使用Box+背景+clip的方式
|
||||
// 前景层:列表项样式 - 移除圆角,改为全宽列表项
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.offset { IntOffset(offsetX.roundToInt(), 0) }
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.background(
|
||||
if (urgentColorAlpha > 0f) {
|
||||
MaterialTheme.colorScheme.errorContainer.copy(alpha = urgentColorAlpha)
|
||||
@ -405,6 +403,15 @@ fun ModernTOTPCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 底部分割线
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(1.dp)
|
||||
.background(MaterialTheme.colorScheme.outline.copy(alpha = 0.12f))
|
||||
.padding(start = 72.dp) // 与左侧图标对齐
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ fun ReorderableBandAccountsList(
|
||||
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = elevation.value),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||
)
|
||||
|
||||
@ -1064,7 +1064,7 @@ fun ReorderableBandAccountsListImpl(
|
||||
scaleY = dragScale
|
||||
)
|
||||
.animateContentSize(),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = elevation.value),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = if (isDragging)
|
||||
MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user