feat: Always display timestamp in ImageAttachment component, regardless of download status

This commit is contained in:
k1ngsterr1
2026-01-25 17:38:09 +05:00
parent 3ece5fe84d
commit f58b941a5e

View File

@@ -292,65 +292,63 @@ fun ImageAttachment(
}
}
// Время в правом нижнем углу (только если изображение загружено)
if (downloadStatus == DownloadStatus.DOWNLOADED) {
Box(
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(8.dp)
.background(
Color.Black.copy(alpha = 0.5f),
shape = RoundedCornerShape(10.dp)
)
.padding(horizontal = 6.dp, vertical = 3.dp)
// Время в правом нижнем углу (всегда показываем, даже когда фото blurred)
Box(
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(8.dp)
.background(
Color.Black.copy(alpha = 0.5f),
shape = RoundedCornerShape(10.dp)
)
.padding(horizontal = 6.dp, vertical = 3.dp)
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(2.dp)
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(2.dp)
) {
Text(
text = timeFormat.format(timestamp),
color = Color.White,
fontSize = 11.sp,
fontWeight = FontWeight.Medium
)
if (isOutgoing) {
// Статус доставки для исходящих
when (messageStatus) {
MessageStatus.SENDING -> {
Icon(
compose.icons.TablerIcons.Clock,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.SENT -> {
Icon(
compose.icons.TablerIcons.Check,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.DELIVERED -> {
Icon(
compose.icons.TablerIcons.Checks,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.READ -> {
Icon(
compose.icons.TablerIcons.Checks,
contentDescription = null,
tint = Color(0xFF4FC3F7),
modifier = Modifier.size(14.dp)
)
}
else -> {}
Text(
text = timeFormat.format(timestamp),
color = Color.White,
fontSize = 11.sp,
fontWeight = FontWeight.Medium
)
if (isOutgoing) {
// Статус доставки для исходящих
when (messageStatus) {
MessageStatus.SENDING -> {
Icon(
compose.icons.TablerIcons.Clock,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.SENT -> {
Icon(
compose.icons.TablerIcons.Check,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.DELIVERED -> {
Icon(
compose.icons.TablerIcons.Checks,
contentDescription = null,
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(14.dp)
)
}
MessageStatus.READ -> {
Icon(
compose.icons.TablerIcons.Checks,
contentDescription = null,
tint = Color(0xFF4FC3F7),
modifier = Modifier.size(14.dp)
)
}
else -> {}
}
}
}