feat: add channel message support and refactor UI components

- Implement `VkChannelMessage` domain and data models for channel message attachments
- Add `CHANNEL_MESSAGE` to `AttachmentType` and map it to relevant UI resources and strings
- Refactor `Sticker` and `Gift` composables to accept URL strings instead of domain objects for better decoupling
- Simplify `AppTheme` by removing redundant color animations and passing the color scheme directly to `MaterialExpressiveTheme`
- Update `LoginScreen` to include a theme toggle (classic vs. light) and improve back-button behavior by resetting error states
- Bump VK API version from 5.238 to 5.263
- Adjust layout and padding for sticker and gift attachment previews
This commit is contained in:
2026-05-19 22:54:44 +03:00
parent b31c0f30c5
commit 574b230b26
13 changed files with 125 additions and 46 deletions
@@ -119,12 +119,15 @@ fun Attachments(
AttachmentType.STICKER -> {
Sticker(
item = attachment as VkStickerDomain
url = (attachment as VkStickerDomain).getUrl(
width = 256,
withBackground = false
)
)
}
AttachmentType.GIFT -> {
Gift(item = attachment as VkGiftDomain)
Gift(url = (attachment as VkGiftDomain).getDefaultThumbSizeOrLess())
}
AttachmentType.VIDEO_MESSAGE -> {
@@ -21,25 +21,24 @@ import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import dev.meloda.fast.model.api.domain.VkGiftDomain
import dev.meloda.fast.ui.R
@Composable
fun Gift(
modifier: Modifier = Modifier,
item: VkGiftDomain
url: String
) {
Column(
modifier = modifier.width(192.dp),
modifier = modifier
.width(208.dp)
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
AsyncImage(
model = item.getDefaultThumbSizeOrLess(),
model = url,
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.padding(8.dp)
.fillMaxWidth()
modifier = Modifier.size(192.dp)
)
Row(
@@ -10,27 +10,23 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import dev.meloda.fast.model.api.domain.VkStickerDomain
@Composable
fun Sticker(
modifier: Modifier = Modifier,
item: VkStickerDomain
url: String?
) {
Box(
modifier = modifier.size(192.dp),
modifier = modifier
.size(208.dp)
.padding(8.dp),
contentAlignment = Alignment.Center
) {
AsyncImage(
model = item.getUrl(
width = 256,
withBackground = false
),
model = url,
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.padding(8.dp)
.fillMaxSize()
modifier = Modifier.fillMaxSize()
)
}
}