From b63909eafd01ff95fc6546b767b0c5db9812e6ca Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Fri, 9 Jan 2026 04:12:24 +0500 Subject: [PATCH] feat: Update UnlockScreen to conditionally enable dropdown and show arrow only for multiple accounts --- .../rosetta/messenger/ui/auth/UnlockScreen.kt | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/auth/UnlockScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/auth/UnlockScreen.kt index c62aea7..8ca6aba 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/auth/UnlockScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/auth/UnlockScreen.kt @@ -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)