feat: Add rounded corners to account list item and add account button in SelectAccountScreen and UnlockScreen

This commit is contained in:
2026-01-09 03:27:44 +05:00
parent 3cad4edd9b
commit ec70d1e216
9 changed files with 25 additions and 26 deletions

View File

@@ -163,6 +163,7 @@ class MainActivity : ComponentActivity() {
}, },
onLogout = { onLogout = {
scope.launch { scope.launch {
com.rosetta.messenger.network.ProtocolManager.disconnect()
accountManager.logout() accountManager.logout()
currentAccount = null currentAccount = null
} }
@@ -180,6 +181,7 @@ class MainActivity : ComponentActivity() {
}, },
onLogout = { onLogout = {
scope.launch { scope.launch {
com.rosetta.messenger.network.ProtocolManager.disconnect()
accountManager.logout() accountManager.logout()
currentAccount = null currentAccount = null
} }

View File

@@ -102,6 +102,7 @@ class Protocol(
} }
isManuallyClosed = false isManuallyClosed = false
reconnectAttempts = 0 // Reset reconnect attempts on new connection
_state.value = ProtocolState.CONNECTING _state.value = ProtocolState.CONNECTING
_lastError.value = null _lastError.value = null

View File

@@ -78,11 +78,7 @@ fun AuthFlow(
AuthScreen.SEED_PHRASE -> { AuthScreen.SEED_PHRASE -> {
SeedPhraseScreen( SeedPhraseScreen(
isDarkTheme = isDarkTheme, isDarkTheme = isDarkTheme,
onBack = { onBack = { currentScreen = AuthScreen.WELCOME },
currentScreen = if (hasExistingAccount && accounts.size > 1)
AuthScreen.SELECT_ACCOUNT
else AuthScreen.WELCOME
},
onConfirm = { words -> onConfirm = { words ->
seedPhrase = words seedPhrase = words
currentScreen = AuthScreen.CONFIRM_SEED currentScreen = AuthScreen.CONFIRM_SEED
@@ -111,11 +107,7 @@ fun AuthFlow(
AuthScreen.IMPORT_SEED -> { AuthScreen.IMPORT_SEED -> {
ImportSeedPhraseScreen( ImportSeedPhraseScreen(
isDarkTheme = isDarkTheme, isDarkTheme = isDarkTheme,
onBack = { onBack = { currentScreen = AuthScreen.WELCOME },
currentScreen = if (hasExistingAccount && accounts.size > 1)
AuthScreen.SELECT_ACCOUNT
else AuthScreen.WELCOME
},
onSeedPhraseImported = { words -> onSeedPhraseImported = { words ->
seedPhrase = words seedPhrase = words
currentScreen = AuthScreen.SET_PASSWORD currentScreen = AuthScreen.SET_PASSWORD

View File

@@ -373,8 +373,8 @@ fun ConfirmSeedPhraseScreen(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = PrimaryBlue, containerColor = PrimaryBlue,
contentColor = Color.White, contentColor = Color.White,
disabledContainerColor = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8), disabledContainerColor = PrimaryBlue.copy(alpha = 0.5f),
disabledContentColor = if (isDarkTheme) Color(0xFF666666) else Color(0xFF999999) disabledContentColor = Color.White.copy(alpha = 0.5f)
), ),
shape = RoundedCornerShape(12.dp) shape = RoundedCornerShape(12.dp)
) { ) {

View File

@@ -271,8 +271,8 @@ fun ImportSeedPhraseScreen(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = PrimaryBlue, containerColor = PrimaryBlue,
contentColor = Color.White, contentColor = Color.White,
disabledContainerColor = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8), disabledContainerColor = PrimaryBlue.copy(alpha = 0.5f),
disabledContentColor = if (isDarkTheme) Color(0xFF666666) else Color(0xFF999999) disabledContentColor = Color.White.copy(alpha = 0.5f)
), ),
shape = RoundedCornerShape(12.dp) shape = RoundedCornerShape(12.dp)
) { ) {

View File

@@ -227,8 +227,8 @@ fun SeedPhraseScreen(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = PrimaryBlue, containerColor = PrimaryBlue,
contentColor = Color.White, contentColor = Color.White,
disabledContainerColor = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8), disabledContainerColor = PrimaryBlue.copy(alpha = 0.5f),
disabledContentColor = if (isDarkTheme) Color(0xFF666666) else Color(0xFF999999) disabledContentColor = Color.White.copy(alpha = 0.5f)
), ),
shape = RoundedCornerShape(12.dp) shape = RoundedCornerShape(12.dp)
) { ) {

View File

@@ -278,6 +278,7 @@ private fun AccountListItem(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(80.dp) .height(80.dp)
.clip(RoundedCornerShape(16.dp))
.clickable(onClick = onClick), .clickable(onClick = onClick),
shape = RoundedCornerShape(16.dp), shape = RoundedCornerShape(16.dp),
colors = CardDefaults.cardColors( colors = CardDefaults.cardColors(
@@ -386,6 +387,7 @@ private fun AddAccountButton(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(64.dp) .height(64.dp)
.clip(RoundedCornerShape(16.dp))
.clickable(onClick = onClick), .clickable(onClick = onClick),
shape = RoundedCornerShape(16.dp), shape = RoundedCornerShape(16.dp),
colors = CardDefaults.cardColors(containerColor = surfaceColor), colors = CardDefaults.cardColors(containerColor = surfaceColor),

View File

@@ -208,6 +208,7 @@ fun UnlockScreen(
Card( Card(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clip(RoundedCornerShape(16.dp))
.clickable { isDropdownExpanded = !isDropdownExpanded }, .clickable { isDropdownExpanded = !isDropdownExpanded },
colors = CardDefaults.cardColors(containerColor = cardBackground), colors = CardDefaults.cardColors(containerColor = cardBackground),
shape = RoundedCornerShape(16.dp) shape = RoundedCornerShape(16.dp)
@@ -352,6 +353,7 @@ fun UnlockScreen(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.scale(itemScale) .scale(itemScale)
.clip(RoundedCornerShape(12.dp))
.clickable { .clickable {
selectedAccount = account selectedAccount = account
isDropdownExpanded = false isDropdownExpanded = false

View File

@@ -337,12 +337,13 @@ fun ChatsListScreen(
ModalNavigationDrawer( ModalNavigationDrawer(
drawerState = drawerState, drawerState = drawerState,
drawerContent = { drawerContent = {
ModalDrawerSheet( // Custom drawer content - use PermanentDrawerSheet with no insets
PermanentDrawerSheet(
modifier = Modifier modifier = Modifier
.width(300.dp) .width(300.dp)
.fillMaxHeight(), .fillMaxHeight(),
drawerContainerColor = drawerBackgroundColor, drawerContainerColor = drawerBackgroundColor,
windowInsets = WindowInsets(0, 0, 0, 0) // Remove all insets to cover entire screen windowInsets = WindowInsets(0, 0, 0, 0)
) { ) {
// Header with logo and theme toggle // Header with logo and theme toggle
Box( Box(
@@ -389,17 +390,17 @@ fun ChatsListScreen(
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
// Public key - truncated and styled // Public key - truncated and styled like nickname
val truncatedKey = if (accountPublicKey.length > 12) { val truncatedKey = if (accountPublicKey.length > 12) {
"${accountPublicKey.take(6)}...${accountPublicKey.takeLast(4)}" "${accountPublicKey.take(6)}...${accountPublicKey.takeLast(4)}"
} else accountPublicKey } else accountPublicKey
Text( Text(
text = truncatedKey, text = truncatedKey,
fontSize = 13.sp, fontSize = 17.sp,
fontWeight = FontWeight.Normal, fontWeight = FontWeight.SemiBold,
color = secondaryTextColor, color = textColor,
letterSpacing = 0.5.sp, letterSpacing = 0.3.sp,
maxLines = 1 maxLines = 1
) )
} }
@@ -474,9 +475,8 @@ fun ChatsListScreen(
) )
} }
// Spacer to push content above navigation bar // Bottom spacer for navigation bar area (content padding only)
Spacer(modifier = Modifier.navigationBarsPadding()) Spacer(modifier = Modifier.height(48.dp))
Spacer(modifier = Modifier.height(16.dp))
} }
} }
) { ) {