feat: Update UnlockScreen to conditionally enable dropdown and show arrow only for multiple accounts

This commit is contained in:
k1ngsterr1
2026-01-09 04:12:24 +05:00
parent 68fec47790
commit b63909eafd

View File

@@ -234,7 +234,9 @@ fun UnlockScreen(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clip(RoundedCornerShape(16.dp)) .clip(RoundedCornerShape(16.dp))
.clickable { isDropdownExpanded = !isDropdownExpanded }, .clickable(enabled = accounts.size > 1) {
isDropdownExpanded = !isDropdownExpanded
},
colors = CardDefaults.cardColors(containerColor = cardBackground), colors = CardDefaults.cardColors(containerColor = cardBackground),
shape = RoundedCornerShape(16.dp) shape = RoundedCornerShape(16.dp)
) { ) {
@@ -286,23 +288,25 @@ fun UnlockScreen(
} }
} }
// Dropdown arrow with rotation // Dropdown arrow with rotation (only show if multiple accounts)
Icon( if (accounts.size > 1) {
imageVector = Icons.Default.KeyboardArrowDown, Icon(
contentDescription = null, imageVector = Icons.Default.KeyboardArrowDown,
tint = secondaryTextColor, contentDescription = null,
modifier = Modifier tint = secondaryTextColor,
.size(24.dp) modifier = Modifier
.graphicsLayer { .size(24.dp)
rotationZ = 180f * dropdownProgress .graphicsLayer {
} rotationZ = 180f * dropdownProgress
) }
)
}
} }
} }
// Dropdown list with animation // Dropdown list with animation
AnimatedVisibility( AnimatedVisibility(
visible = isDropdownExpanded, visible = isDropdownExpanded && accounts.size > 1,
enter = fadeIn(tween(150)) + expandVertically( enter = fadeIn(tween(150)) + expandVertically(
expandFrom = Alignment.Top, expandFrom = Alignment.Top,
animationSpec = tween(200, easing = FastOutSlowInEasing) animationSpec = tween(200, easing = FastOutSlowInEasing)