feat: Update UnlockScreen to conditionally enable dropdown and show arrow only for multiple accounts
This commit is contained in:
@@ -234,7 +234,9 @@ fun UnlockScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable { isDropdownExpanded = !isDropdownExpanded },
|
||||
.clickable(enabled = accounts.size > 1) {
|
||||
isDropdownExpanded = !isDropdownExpanded
|
||||
},
|
||||
colors = CardDefaults.cardColors(containerColor = cardBackground),
|
||||
shape = RoundedCornerShape(16.dp)
|
||||
) {
|
||||
@@ -286,23 +288,25 @@ fun UnlockScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// Dropdown arrow with rotation
|
||||
Icon(
|
||||
imageVector = Icons.Default.KeyboardArrowDown,
|
||||
contentDescription = null,
|
||||
tint = secondaryTextColor,
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.graphicsLayer {
|
||||
rotationZ = 180f * dropdownProgress
|
||||
}
|
||||
)
|
||||
// Dropdown arrow with rotation (only show if multiple accounts)
|
||||
if (accounts.size > 1) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.KeyboardArrowDown,
|
||||
contentDescription = null,
|
||||
tint = secondaryTextColor,
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.graphicsLayer {
|
||||
rotationZ = 180f * dropdownProgress
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dropdown list with animation
|
||||
AnimatedVisibility(
|
||||
visible = isDropdownExpanded,
|
||||
visible = isDropdownExpanded && accounts.size > 1,
|
||||
enter = fadeIn(tween(150)) + expandVertically(
|
||||
expandFrom = Alignment.Top,
|
||||
animationSpec = tween(200, easing = FastOutSlowInEasing)
|
||||
|
||||
Reference in New Issue
Block a user