mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3176 Space-level chat | Enhancement | Bubble updates (#1980)
This commit is contained in:
parent
18bcb0561c
commit
e5878b0a03
4 changed files with 21 additions and 22 deletions
|
@ -23,6 +23,7 @@
|
|||
<color name="shape_tertiary">#1F1F1F</color>
|
||||
<color name="shape_transparent">#24DAD7CA</color>
|
||||
<color name="shape_transparent_primary">#3DFFFFFF</color>
|
||||
<color name="shape_transparent_secondary">#29FFFFFF</color>
|
||||
|
||||
<color name="transparent_active">#66FFFFFF</color>
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
<color name="shape_tertiary">#F2F2F2</color>
|
||||
<color name="shape_transparent">#14535353</color>
|
||||
<color name="shape_transparent_primary">#1C000000</color>
|
||||
<color name="shape_transparent_secondary">#0D000000</color>
|
||||
|
||||
<color name="glyph_active">#A7A7A7</color>
|
||||
<color name="glyph_selected">#252525</color>
|
||||
|
|
|
@ -254,7 +254,7 @@ class DiscussionViewModel @Inject constructor(
|
|||
timeInMillis = msg.createdAt * 1000L
|
||||
)
|
||||
add(view)
|
||||
if (currDate != previousDate) {
|
||||
if (currDate.formattedDate != previousDate?.formattedDate) {
|
||||
add(currDate)
|
||||
previousDate = currDate
|
||||
}
|
||||
|
|
|
@ -1250,9 +1250,9 @@ fun Bubble(
|
|||
.width(IntrinsicSize.Max)
|
||||
.background(
|
||||
color = if (isUserAuthor)
|
||||
colorResource(R.color.navigation_panel_icon)
|
||||
colorResource(R.color.background_primary)
|
||||
else
|
||||
colorResource(R.color.navigation_panel),
|
||||
colorResource(R.color.shape_transparent_secondary),
|
||||
shape = RoundedCornerShape(20.dp)
|
||||
)
|
||||
.clip(RoundedCornerShape(20.dp))
|
||||
|
@ -1267,7 +1267,7 @@ fun Bubble(
|
|||
.fillMaxWidth()
|
||||
.height(52.dp)
|
||||
.background(
|
||||
color = colorResource(R.color.navigation_panel_icon),
|
||||
color = colorResource(R.color.shape_transparent_secondary),
|
||||
shape = RoundedCornerShape(16.dp)
|
||||
)
|
||||
.clickable {
|
||||
|
@ -1283,7 +1283,7 @@ fun Bubble(
|
|||
),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = colorResource(id = R.color.text_white)
|
||||
color = colorResource(id = R.color.text_primary)
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.padding(
|
||||
|
@ -1294,7 +1294,7 @@ fun Bubble(
|
|||
text = reply.text,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = colorResource(id = R.color.text_white),
|
||||
color = colorResource(id = R.color.text_primary),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -1311,10 +1311,7 @@ fun Bubble(
|
|||
Text(
|
||||
text = name,
|
||||
style = PreviewTitle2Medium,
|
||||
color = if (isUserAuthor)
|
||||
colorResource(id = R.color.text_white)
|
||||
else
|
||||
colorResource(id = R.color.text_primary),
|
||||
color = colorResource(id = R.color.text_primary),
|
||||
maxLines = 1
|
||||
)
|
||||
Spacer(Modifier.width(12.dp))
|
||||
|
@ -1324,10 +1321,7 @@ fun Bubble(
|
|||
TIME_H24
|
||||
),
|
||||
style = Caption1Regular,
|
||||
color = if (isUserAuthor)
|
||||
colorResource(id = R.color.text_white)
|
||||
else
|
||||
colorResource(id = R.color.text_secondary),
|
||||
color = colorResource(id = R.color.text_secondary),
|
||||
maxLines = 1
|
||||
)
|
||||
}
|
||||
|
@ -1385,12 +1379,13 @@ fun Bubble(
|
|||
}
|
||||
},
|
||||
style = BodyRegular,
|
||||
color = if (isUserAuthor)
|
||||
colorResource(id = R.color.text_white)
|
||||
else
|
||||
colorResource(id = R.color.text_primary),
|
||||
color = colorResource(id = R.color.text_primary),
|
||||
)
|
||||
BubbleAttachments(
|
||||
attachments = attachments,
|
||||
isUserAuthor = isUserAuthor,
|
||||
onAttachmentClicked = onAttachmentClicked
|
||||
)
|
||||
BubbleAttachments(attachments, onAttachmentClicked)
|
||||
if (reactions.isNotEmpty()) {
|
||||
ReactionList(
|
||||
reactions = reactions,
|
||||
|
@ -1495,7 +1490,8 @@ fun Bubble(
|
|||
@OptIn(ExperimentalGlideComposeApi::class)
|
||||
private fun BubbleAttachments(
|
||||
attachments: List<DiscussionView.Message.Attachment>,
|
||||
onAttachmentClicked: (DiscussionView.Message.Attachment) -> Unit
|
||||
onAttachmentClicked: (DiscussionView.Message.Attachment) -> Unit,
|
||||
isUserAuthor: Boolean
|
||||
) {
|
||||
attachments.forEach { attachment ->
|
||||
when (attachment) {
|
||||
|
@ -1522,7 +1518,8 @@ private fun BubbleAttachments(
|
|||
end = 16.dp,
|
||||
top = 8.dp
|
||||
)
|
||||
.fillMaxWidth(),
|
||||
.fillMaxWidth()
|
||||
,
|
||||
title = attachment.wrapper?.name.orEmpty(),
|
||||
type = attachment.typeName,
|
||||
icon = attachment.icon,
|
||||
|
@ -1596,7 +1593,7 @@ fun AttachedObject(
|
|||
.clip(RoundedCornerShape(12.dp))
|
||||
.border(
|
||||
width = 1.dp,
|
||||
color = colorResource(id = R.color.shape_tertiary),
|
||||
color = colorResource(id = R.color.shape_transparent_secondary),
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
)
|
||||
.background(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue