fix: adjust colors in VerifiedBadge for dark theme compatibility
This commit is contained in:
@@ -971,7 +971,8 @@ fun ChatDetailScreen(
|
|||||||
verified =
|
verified =
|
||||||
user.verified,
|
user.verified,
|
||||||
size =
|
size =
|
||||||
16
|
16,
|
||||||
|
isDarkTheme = isDarkTheme
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1195,10 +1196,10 @@ fun ChatDetailScreen(
|
|||||||
modifier =
|
modifier =
|
||||||
Modifier.fillMaxWidth()
|
Modifier.fillMaxWidth()
|
||||||
.padding(
|
.padding(
|
||||||
horizontal =
|
start = 12.dp,
|
||||||
12.dp,
|
end = 12.dp,
|
||||||
vertical =
|
top = 8.dp,
|
||||||
8.dp
|
bottom = 16.dp
|
||||||
)
|
)
|
||||||
.navigationBarsPadding()
|
.navigationBarsPadding()
|
||||||
.graphicsLayer {
|
.graphicsLayer {
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ private fun SearchResultItem(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (!isOwnAccount && user.verified > 0) {
|
if (!isOwnAccount && user.verified > 0) {
|
||||||
VerifiedBadge(verified = user.verified, size = 16)
|
VerifiedBadge(verified = user.verified, size = 16, isDarkTheme = isDarkTheme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.rosetta.messenger.ui.components
|
package com.rosetta.messenger.ui.components
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
@@ -20,12 +21,14 @@ import androidx.compose.ui.window.Dialog
|
|||||||
*
|
*
|
||||||
* @param verified Уровень верификации (0 = нет, 1 = стандартная, 2+ = особая)
|
* @param verified Уровень верификации (0 = нет, 1 = стандартная, 2+ = особая)
|
||||||
* @param size Размер значка в dp
|
* @param size Размер значка в dp
|
||||||
|
* @param isDarkTheme Тема приложения (если не передано - используется системная)
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun VerifiedBadge(
|
fun VerifiedBadge(
|
||||||
verified: Int,
|
verified: Int,
|
||||||
size: Int = 16,
|
size: Int = 16,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier,
|
||||||
|
isDarkTheme: Boolean = isSystemInDarkTheme()
|
||||||
) {
|
) {
|
||||||
if (verified <= 0) return
|
if (verified <= 0) return
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ fun VerifiedBadge(
|
|||||||
Dialog(onDismissRequest = { showDialog = false }) {
|
Dialog(onDismissRequest = { showDialog = false }) {
|
||||||
Surface(
|
Surface(
|
||||||
shape = RoundedCornerShape(12.dp),
|
shape = RoundedCornerShape(12.dp),
|
||||||
color = Color(0xFF2A2A2A), // Темный фон
|
color = if (isDarkTheme) Color(0xFF2A2A2A) else Color.White,
|
||||||
tonalElevation = 8.dp
|
tonalElevation = 8.dp
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
@@ -76,13 +79,13 @@ fun VerifiedBadge(
|
|||||||
Text(
|
Text(
|
||||||
text = annotationText,
|
text = annotationText,
|
||||||
fontSize = 14.sp,
|
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,
|
lineHeight = 20.sp,
|
||||||
textAlign = androidx.compose.ui.text.style.TextAlign.Center
|
textAlign = androidx.compose.ui.text.style.TextAlign.Center
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
TextButton(onClick = { showDialog = false }) {
|
TextButton(onClick = { showDialog = false }) {
|
||||||
Text("OK", color = Color.White)
|
Text("OK", color = if (isDarkTheme) Color.White else Color(0xFF1DA1F2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.ArrowBack,
|
imageVector = Icons.Filled.ArrowBack,
|
||||||
contentDescription = "Back",
|
contentDescription = "Back",
|
||||||
tint = Color.White,
|
tint = if (isDarkTheme) Color.White else Color.Black,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -596,7 +596,7 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.MoreVert,
|
imageVector = Icons.Default.MoreVert,
|
||||||
contentDescription = "Profile menu",
|
contentDescription = "Profile menu",
|
||||||
tint = Color.White,
|
tint = if (isDarkTheme) Color.White else Color.Black,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -654,7 +654,7 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
|
|
||||||
if (verified > 0) {
|
if (verified > 0) {
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -839,7 +839,7 @@ private fun CollapsingProfileHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = TablerIcons.ArrowLeft,
|
imageVector = TablerIcons.ArrowLeft,
|
||||||
contentDescription = "Back",
|
contentDescription = "Back",
|
||||||
tint = Color.White,
|
tint = if (isDarkTheme) Color.White else Color.Black,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -873,7 +873,7 @@ private fun CollapsingProfileHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = TablerIcons.DotsVertical,
|
imageVector = TablerIcons.DotsVertical,
|
||||||
contentDescription = "Profile menu",
|
contentDescription = "Profile menu",
|
||||||
tint = Color.White,
|
tint = if (isDarkTheme) Color.White else Color.Black,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1034,7 @@ fun ProfileCard(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = TablerIcons.ArrowLeft,
|
imageVector = TablerIcons.ArrowLeft,
|
||||||
contentDescription = "Back",
|
contentDescription = "Back",
|
||||||
tint = Color.White
|
tint = if (isDarkTheme) Color.White else Color.Black
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user