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,7 +288,8 @@ fun UnlockScreen(
} }
} }
// Dropdown arrow with rotation // Dropdown arrow with rotation (only show if multiple accounts)
if (accounts.size > 1) {
Icon( Icon(
imageVector = Icons.Default.KeyboardArrowDown, imageVector = Icons.Default.KeyboardArrowDown,
contentDescription = null, contentDescription = null,
@@ -299,10 +302,11 @@ fun UnlockScreen(
) )
} }
} }
}
// 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)