diff --git a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/MainActivity.kt b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/MainActivity.kt index 1333b64..6c0d874 100644 --- a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/MainActivity.kt +++ b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/MainActivity.kt @@ -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 { // 拖拽排序模式下的账户卡片 diff --git a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ModernTOTPCard.kt b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ModernTOTPCard.kt index f5a1f8d..2e162e7 100644 --- a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ModernTOTPCard.kt +++ b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ModernTOTPCard.kt @@ -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) // 与左侧图标对齐 + ) } } } diff --git a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ReorderableBandAccountsList.kt b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ReorderableBandAccountsList.kt index c3f4bbf..1071656 100644 --- a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ReorderableBandAccountsList.kt +++ b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/ReorderableBandAccountsList.kt @@ -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 ) diff --git a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/SyncScreen.kt b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/SyncScreen.kt index 38cf0b5..9b1c434 100644 --- a/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/SyncScreen.kt +++ b/app/src/main/java/cn/deepfal/band/TOTPauthenticator/components/SyncScreen.kt @@ -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