mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3444 Chats | Enhancement | Bookmark flow updates - minor fixes (#2403)
This commit is contained in:
parent
48b11cb886
commit
734eeecbc1
3 changed files with 16 additions and 7 deletions
|
@ -830,7 +830,7 @@ class ChatViewModel @Inject constructor(
|
|||
// TODO
|
||||
}
|
||||
is ChatView.Message.Attachment.Bookmark -> {
|
||||
// TODO
|
||||
commands.emit(ViewModelCommand.Browse(attachment.url))
|
||||
}
|
||||
is ChatView.Message.Attachment.Link -> {
|
||||
val wrapper = attachment.wrapper
|
||||
|
|
|
@ -121,7 +121,10 @@ fun BubbleAttachments(
|
|||
url = attachment.url,
|
||||
title = attachment.title,
|
||||
description = attachment.description,
|
||||
imageUrl = attachment.imageUrl
|
||||
imageUrl = attachment.imageUrl,
|
||||
onClick = {
|
||||
onAttachmentClicked(attachment)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -204,10 +207,16 @@ fun Bookmark(
|
|||
url: String,
|
||||
title: String,
|
||||
description: String,
|
||||
imageUrl: String?
|
||||
imageUrl: String?,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth().padding(4.dp),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(4.dp)
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.clickable { onClick() }
|
||||
,
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = colorResource(R.color.shape_transparent_secondary)
|
||||
),
|
||||
|
@ -218,7 +227,6 @@ fun Bookmark(
|
|||
painter = rememberAsyncImagePainter(imageUrl),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.background(color = Color.Red)
|
||||
.aspectRatio(1.91f),
|
||||
contentDescription = null,
|
||||
contentScale = ContentScale.Crop
|
||||
|
@ -256,7 +264,8 @@ fun BookmarkPreview() {
|
|||
url = "algo.tv",
|
||||
title = "Algo - Video Automation",
|
||||
description = "Algo is a data-visualization studio specializing in video automation.",
|
||||
imageUrl = null
|
||||
imageUrl = null,
|
||||
onClick = {}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ import com.anytypeio.anytype.feature_chats.R
|
|||
import com.anytypeio.anytype.feature_chats.presentation.ChatView
|
||||
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
|
||||
|
||||
@OptIn(ExperimentalGlideComposeApi::class, ExperimentalMaterial3Api::class)
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Bubble(
|
||||
modifier: Modifier = Modifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue