fix: adjust colors in VerifiedBadge for dark theme compatibility

This commit is contained in:
k1ngsterr1
2026-02-05 02:19:41 +05:00
parent 4dc7c6e9bc
commit a03e267050
5 changed files with 20 additions and 16 deletions

View File

@@ -971,7 +971,8 @@ fun ChatDetailScreen(
verified =
user.verified,
size =
16
16,
isDarkTheme = isDarkTheme
)
}
}
@@ -1195,10 +1196,10 @@ fun ChatDetailScreen(
modifier =
Modifier.fillMaxWidth()
.padding(
horizontal =
12.dp,
vertical =
8.dp
start = 12.dp,
end = 12.dp,
top = 8.dp,
bottom = 16.dp
)
.navigationBarsPadding()
.graphicsLayer {

View File

@@ -236,7 +236,7 @@ private fun SearchResultItem(
)
if (!isOwnAccount && user.verified > 0) {
VerifiedBadge(verified = user.verified, size = 16)
VerifiedBadge(verified = user.verified, size = 16, isDarkTheme = isDarkTheme)
}
}

View File

@@ -1,6 +1,7 @@
package com.rosetta.messenger.ui.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
@@ -20,12 +21,14 @@ import androidx.compose.ui.window.Dialog
*
* @param verified Уровень верификации (0 = нет, 1 = стандартная, 2+ = особая)
* @param size Размер значка в dp
* @param isDarkTheme Тема приложения (если не передано - используется системная)
*/
@Composable
fun VerifiedBadge(
verified: Int,
size: Int = 16,
modifier: Modifier = Modifier
modifier: Modifier = Modifier,
isDarkTheme: Boolean = isSystemInDarkTheme()
) {
if (verified <= 0) return
@@ -59,7 +62,7 @@ fun VerifiedBadge(
Dialog(onDismissRequest = { showDialog = false }) {
Surface(
shape = RoundedCornerShape(12.dp),
color = Color(0xFF2A2A2A), // Темный фон
color = if (isDarkTheme) Color(0xFF2A2A2A) else Color.White,
tonalElevation = 8.dp
) {
Column(
@@ -76,13 +79,13 @@ fun VerifiedBadge(
Text(
text = annotationText,
fontSize = 14.sp,
color = Color.White.copy(alpha = 0.85f), // Белый текст для темного фона
color = if (isDarkTheme) Color.White.copy(alpha = 0.85f) else Color.Black.copy(alpha = 0.85f),
lineHeight = 20.sp,
textAlign = androidx.compose.ui.text.style.TextAlign.Center
)
Spacer(modifier = Modifier.height(16.dp))
TextButton(onClick = { showDialog = false }) {
Text("OK", color = Color.White)
Text("OK", color = if (isDarkTheme) Color.White else Color(0xFF1DA1F2))
}
}
}

View File

@@ -575,7 +575,7 @@ private fun CollapsingOtherProfileHeader(
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = "Back",
tint = Color.White,
tint = if (isDarkTheme) Color.White else Color.Black,
modifier = Modifier.size(24.dp)
)
}
@@ -596,7 +596,7 @@ private fun CollapsingOtherProfileHeader(
Icon(
imageVector = Icons.Default.MoreVert,
contentDescription = "Profile menu",
tint = Color.White,
tint = if (isDarkTheme) Color.White else Color.Black,
modifier = Modifier.size(24.dp)
)
}
@@ -654,7 +654,7 @@ private fun CollapsingOtherProfileHeader(
if (verified > 0) {
Spacer(modifier = Modifier.width(4.dp))
VerifiedBadge(verified = verified, size = (nameFontSize.value * 0.8f).toInt())
VerifiedBadge(verified = verified, size = (nameFontSize.value * 0.8f).toInt(), isDarkTheme = isDarkTheme)
}
}

View File

@@ -839,7 +839,7 @@ private fun CollapsingProfileHeader(
Icon(
imageVector = TablerIcons.ArrowLeft,
contentDescription = "Back",
tint = Color.White,
tint = if (isDarkTheme) Color.White else Color.Black,
modifier = Modifier.size(24.dp)
)
}
@@ -873,7 +873,7 @@ private fun CollapsingProfileHeader(
Icon(
imageVector = TablerIcons.DotsVertical,
contentDescription = "Profile menu",
tint = Color.White,
tint = if (isDarkTheme) Color.White else Color.Black,
modifier = Modifier.size(24.dp)
)
}
@@ -1034,7 +1034,7 @@ fun ProfileCard(
Icon(
imageVector = TablerIcons.ArrowLeft,
contentDescription = "Back",
tint = Color.White
tint = if (isDarkTheme) Color.White else Color.Black
)
}
}