From da1627bf7248c0bd4528f2e8bd94c931dcb5da65 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Tue, 3 Feb 2026 08:27:44 +0200 Subject: [PATCH] Improved suggestion coloring --- app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt | 9 +++------ app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt index 4229910b..0d67215f 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt @@ -483,7 +483,6 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc ) val suggestions by remember { contactNames } - // 1. Change state to hold AnnotatedStrings var filteredSuggestions by remember { mutableStateOf>(emptyList()) } var showSuggestions by remember { mutableStateOf(false) } val lazyListState = rememberLazyListState() @@ -505,7 +504,7 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc modifier = Modifier .shadow(8.dp, RoundedCornerShape(8.dp)) .background( - color = MaterialTheme.colorScheme.surfaceContainer, + color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(8.dp) ) .animateContentSize() @@ -524,7 +523,6 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc state = lazyListState ) { items( - // 3. Update key and clickable logic items = filteredSuggestions, key = { suggestion -> suggestion.toString() } ) { suggestion -> @@ -538,9 +536,9 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc .padding(12.dp) ) { Text( - text = suggestion, // Text composable accepts AnnotatedString + text = suggestion, modifier = Modifier.fillMaxWidth(), - color = MaterialTheme.colorScheme.onSurface, + color = MaterialTheme.colorScheme.onSurfaceVariant, fontSize = 18.sp ) } @@ -556,7 +554,6 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc onValueChange = { newPeer = it showSuggestions = newPeer.length > 1 - // 2. Update filtering and mapping logic filteredSuggestions = if (it.isEmpty()) { emptyList() } else { diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt index d1620fca..c5ef9f6c 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt @@ -1269,7 +1269,7 @@ private fun CallUriRow( .fillMaxWidth() .shadow(8.dp, RoundedCornerShape(8.dp)) .background( - color = MaterialTheme.colorScheme.surfaceContainer, + color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(8.dp) ) .animateContentSize() @@ -1306,7 +1306,7 @@ private fun CallUriRow( Text( text = suggestion, modifier = Modifier.fillMaxWidth(), - color = MaterialTheme.colorScheme.onSurface, + color = MaterialTheme.colorScheme.onSurfaceVariant, fontSize = 18.sp ) } @@ -1662,7 +1662,7 @@ private fun CallRow( .fillMaxWidth() .shadow(8.dp, RoundedCornerShape(8.dp)) .background( - color = MaterialTheme.colorScheme.surfaceContainerHigh, + color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(8.dp) ) .animateContentSize() @@ -1697,7 +1697,7 @@ private fun CallRow( Text( text = suggestion, modifier = Modifier.fillMaxWidth(), - color = MaterialTheme.colorScheme.onSurface, + color = MaterialTheme.colorScheme.onSurfaceVariant, fontSize = 18.sp ) }