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 f490115..f01991d 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 @@ -278,69 +278,70 @@ fun UnlockScreen( // Dropdown list with animation AnimatedVisibility( visible = isDropdownExpanded, - enter = fadeIn(tween(200)) + expandVertically( + enter = fadeIn(tween(150)) + expandVertically( expandFrom = Alignment.Top, - animationSpec = spring( - dampingRatio = Spring.DampingRatioMediumBouncy, - stiffness = Spring.StiffnessMediumLow - ) + animationSpec = tween(200, easing = FastOutSlowInEasing) ), - exit = fadeOut(tween(150)) + shrinkVertically( + exit = fadeOut(tween(100)) + shrinkVertically( shrinkTowards = Alignment.Top, - animationSpec = tween(200) + animationSpec = tween(150) ) ) { Card( modifier = Modifier .fillMaxWidth() .padding(top = 8.dp) - .heightIn(max = 300.dp), + .heightIn(max = if (accounts.size > 5) 350.dp else ((accounts.size * 64 + 70).dp)), colors = CardDefaults.cardColors(containerColor = cardBackground), shape = RoundedCornerShape(16.dp) ) { Column { - // Search field - OutlinedTextField( - value = searchQuery, - onValueChange = { searchQuery = it }, - placeholder = { - Text( - "Search accounts...", - color = secondaryTextColor.copy(alpha = 0.6f) - ) - }, - leadingIcon = { - Icon( - Icons.Default.Search, - contentDescription = null, - tint = secondaryTextColor - ) - }, - colors = OutlinedTextFieldDefaults.colors( - focusedBorderColor = PrimaryBlue, - unfocusedBorderColor = Color.Transparent, - focusedContainerColor = Color.Transparent, - unfocusedContainerColor = Color.Transparent, - focusedTextColor = textColor, - unfocusedTextColor = textColor, - cursorColor = PrimaryBlue - ), - singleLine = true, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 12.dp, vertical = 8.dp) - .focusRequester(searchFocusRequester), - shape = RoundedCornerShape(12.dp) - ) - - Divider( - color = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE0E0E0), - thickness = 0.5.dp - ) + // Search field - only show if more than 3 accounts + if (accounts.size > 3) { + OutlinedTextField( + value = searchQuery, + onValueChange = { searchQuery = it }, + placeholder = { + Text( + "Search accounts...", + color = secondaryTextColor.copy(alpha = 0.6f) + ) + }, + leadingIcon = { + Icon( + Icons.Default.Search, + contentDescription = null, + tint = secondaryTextColor + ) + }, + colors = OutlinedTextFieldDefaults.colors( + focusedBorderColor = PrimaryBlue, + unfocusedBorderColor = Color.Transparent, + focusedContainerColor = Color.Transparent, + unfocusedContainerColor = Color.Transparent, + focusedTextColor = textColor, + unfocusedTextColor = textColor, + cursorColor = PrimaryBlue + ), + singleLine = true, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 12.dp, vertical = 8.dp) + .focusRequester(searchFocusRequester), + shape = RoundedCornerShape(12.dp) + ) + + Divider( + color = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE0E0E0), + thickness = 0.5.dp + ) + } // Account list LazyColumn( - modifier = Modifier.fillMaxWidth() + modifier = Modifier + .fillMaxWidth() + .padding(vertical = if (accounts.size <= 3) 8.dp else 0.dp) ) { items(filteredAccounts, key = { it.publicKey }) { account -> val isSelected = account.publicKey == selectedAccount?.publicKey diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt index 82b3fa2..69629f0 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt @@ -159,45 +159,27 @@ fun ChatsListScreen( val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed) val scope = rememberCoroutineScope() - // Update status bar and navigation bar + // Update status bar and hide navigation bar completely LaunchedEffect(isDarkTheme, drawerState.isOpen) { if (!view.isInEditMode) { val window = (view.context as android.app.Activity).window val insetsController = androidx.core.view.WindowCompat.getInsetsController(window, view) + + // Status bar insetsController.isAppearanceLightStatusBars = !isDarkTheme - insetsController.isAppearanceLightNavigationBars = !isDarkTheme window.statusBarColor = android.graphics.Color.TRANSPARENT - // When drawer is open, dim the navigation bar to match overlay - window.navigationBarColor = if (drawerState.isOpen) { - // Darker color to match scrim overlay - if (isDarkTheme) 0xFF0D0D0D.toInt() else 0xFF999999.toInt() - } else { - if (isDarkTheme) 0xFF1A1A1A.toInt() else 0xFFFFFFFF.toInt() - } + + // Hide navigation bar completely + insetsController.hide(androidx.core.view.WindowInsetsCompat.Type.navigationBars()) + insetsController.systemBarsBehavior = androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE } } - val backgroundColor by animateColorAsState( - targetValue = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFFFFFFF), - animationSpec = if (!hasInitialized) snap() else tween(800, easing = FastOutSlowInEasing), - label = "backgroundColor" - ) + // Colors - instant change, no animation (to keep sidebar and content in sync) + val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFFFFFFF) val drawerBackgroundColor = if (isDarkTheme) Color(0xFF212121) else Color(0xFFFFFFFF) - val textColor by animateColorAsState( - targetValue = if (isDarkTheme) Color.White else Color.Black, - animationSpec = if (!hasInitialized) snap() else tween(800, easing = FastOutSlowInEasing), - label = "textColor" - ) - val secondaryTextColor by animateColorAsState( - targetValue = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666), - animationSpec = if (!hasInitialized) snap() else tween(800, easing = FastOutSlowInEasing), - label = "secondaryTextColor" - ) - val dividerColor by animateColorAsState( - targetValue = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8), - animationSpec = if (!hasInitialized) snap() else tween(800, easing = FastOutSlowInEasing), - label = "dividerColor" - ) + val textColor = if (isDarkTheme) Color.White else Color.Black + val secondaryTextColor = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666) // Protocol connection state val protocolState by ProtocolManager.state.collectAsState() @@ -684,11 +666,13 @@ fun ChatsListScreen( if (searchButtonScale > 0.01f) { IconButton( - onClick = { isSearchExpanded = true }, + onClick = { /* TODO: Search not implemented yet */ }, + enabled = false, modifier = Modifier.graphicsLayer { scaleX = searchButtonScale scaleY = searchButtonScale rotationZ = searchButtonRotation + alpha = 0.5f } ) { Icon( @@ -708,7 +692,7 @@ fun ChatsListScreen( }, floatingActionButton = { AnimatedVisibility( - visible = visible, + visible = false, // Hidden for now enter = fadeIn(tween(500, delayMillis = 300)) + scaleIn( initialScale = 0.5f, animationSpec = tween(500, delayMillis = 300) @@ -735,9 +719,9 @@ fun ChatsListScreen( .fillMaxSize() .padding(paddingValues) ) { - // Console button + // Console button - hidden for now AnimatedVisibility( - visible = visible, + visible = false, enter = fadeIn(tween(500, delayMillis = 400)) + slideInHorizontally( initialOffsetX = { -it }, animationSpec = tween(500, delayMillis = 400)