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
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user