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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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