Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.material3.FloatingActionButtonDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
Expand Down Expand Up @@ -125,6 +126,7 @@ import com.wire.android.ui.common.error.CoreFailureErrorDialog
import com.wire.android.ui.common.progress.WireCircularProgressIndicator
import com.wire.android.ui.common.snackbar.LocalSnackbarHostState
import com.wire.android.ui.common.snackbar.SwipeableSnackbar
import com.wire.android.ui.common.spacers.HorizontalSpace
import com.wire.android.ui.common.visbility.rememberVisibilityState
import com.wire.android.ui.destinations.ConversationScreenDestination
import com.wire.android.ui.destinations.GroupConversationDetailsScreenDestination
Expand Down Expand Up @@ -940,6 +942,9 @@ private fun ConversationScreen(
},
isInteractionEnabled = messageComposerViewState.interactionAvailability == InteractionAvailability.ENABLED
)

HorizontalDivider(color = colorsScheme().outline)

ConversationBanner(
bannerMessage = bannerMessage,
spannedTexts = listOf(
Expand Down Expand Up @@ -1319,7 +1324,8 @@ fun MessageList(
MessageGroupDateTime(
messageDateTime = serverDate,
messageDateTimeGroup = previousGroup,
now = currentTime
now = currentTime,
isBubbleUiEnabled = isBubbleUiEnabled
)
}
}
Expand Down Expand Up @@ -1358,7 +1364,8 @@ fun MessageList(
MessageGroupDateTime(
messageDateTime = serverDate,
messageDateTimeGroup = currentGroup,
now = currentTime
now = currentTime,
isBubbleUiEnabled = isBubbleUiEnabled
)
}
}
Expand Down Expand Up @@ -1413,7 +1420,8 @@ fun MessageList(
private fun MessageGroupDateTime(
now: Long,
messageDateTime: Date,
messageDateTimeGroup: MessageDateTimeGroup?
messageDateTimeGroup: MessageDateTimeGroup?,
isBubbleUiEnabled: Boolean
) {
val context = LocalContext.current

Expand Down Expand Up @@ -1459,25 +1467,45 @@ private fun MessageGroupDateTime(
null -> ""
}

Row(
Modifier
.fillMaxWidth()
.padding(
top = dimensions().spacing4x,
bottom = dimensions().spacing8x
if (isBubbleUiEnabled) {
Row(
Modifier
.fillMaxWidth()
.padding(dimensions().spacing16x),
verticalAlignment = Alignment.CenterVertically
) {
HorizontalDivider(modifier = Modifier.weight(1F), color = colorsScheme().outline)
HorizontalSpace.x4()
Text(
text = timeString.uppercase(Locale.getDefault()),
maxLines = 1,
color = colorsScheme().onBackground,
style = MaterialTheme.wireTypography.label02,
)
.background(color = colorsScheme().divider)
.padding(
top = dimensions().spacing6x,
bottom = dimensions().spacing6x,
start = dimensions().spacing56x
HorizontalSpace.x4()
HorizontalDivider(modifier = Modifier.weight(1F), color = colorsScheme().outline)
}
} else {
Row(
Modifier
.fillMaxWidth()
.padding(
top = dimensions().spacing4x,
bottom = dimensions().spacing8x
)
.background(color = colorsScheme().divider)
.padding(
top = dimensions().spacing6x,
bottom = dimensions().spacing6x,
start = dimensions().spacing56x
)
) {
Text(
text = timeString.uppercase(Locale.getDefault()),
color = colorsScheme().secondaryText,
style = MaterialTheme.wireTypography.title03,
)
) {
Text(
text = timeString.uppercase(Locale.getDefault()),
color = colorsScheme().secondaryText,
style = MaterialTheme.wireTypography.title03,
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
import com.wire.android.model.Clickable
import com.wire.android.model.ImageAsset
import com.wire.android.ui.common.StatusBox
import com.wire.android.ui.common.applyIf
import com.wire.android.ui.common.clickable
import com.wire.android.ui.common.colorsScheme
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.typography
import com.wire.android.ui.home.conversations.messages.item.MessageStyle
import com.wire.android.ui.home.conversations.messages.item.highlighted
import com.wire.android.ui.home.conversations.messages.item.isBubble
import com.wire.android.ui.home.conversations.model.UIQuotedMessage
import com.wire.android.ui.markdown.MarkdownInline
import com.wire.android.ui.markdown.MessageColors
Expand All @@ -80,7 +82,8 @@
data class QuotedMessageStyle(
val quotedStyle: QuotedStyle,
val messageStyle: MessageStyle,
val selfAccent: Accent
val selfAccent: Accent,
val senderAccent: Accent

Check warning on line 86 in app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/QuotedMessage.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/QuotedMessage.kt#L85-L86

Added lines #L85 - L86 were not covered by tests
)

/**
Expand Down Expand Up @@ -201,7 +204,7 @@
modifier = modifier,
messageData = quotedMessageData,
clickable = null,
style = QuotedMessageStyle(QuotedStyle.PREVIEW, MessageStyle.NORMAL, Accent.Unknown)
style = QuotedMessageStyle(QuotedStyle.PREVIEW, MessageStyle.NORMAL, Accent.Unknown, quotedMessageData.senderAccent)
) {
Box(
modifier = Modifier
Expand Down Expand Up @@ -244,11 +247,6 @@
MessageStyle.BUBBLE_OTHER -> colorsScheme().otherBubble.secondary
MessageStyle.NORMAL -> MaterialTheme.wireColorScheme.surfaceVariant
}
val quoteOutlineColor = when (style.messageStyle) {
MessageStyle.BUBBLE_SELF -> colorsScheme().selfBubble.secondary
MessageStyle.BUBBLE_OTHER -> colorsScheme().otherBubble.secondary
MessageStyle.NORMAL -> colorsScheme().outline
}

Row(
horizontalArrangement = Arrangement.spacedBy(dimensions().spacing4x),
Expand All @@ -257,11 +255,13 @@
color = background,
shape = quoteOutlineShape
)
.border(
width = 1.dp,
color = quoteOutlineColor,
shape = quoteOutlineShape
)
.applyIf(!style.messageStyle.isBubble()) {
border(
width = 1.dp,
color = MaterialTheme.wireColorScheme.outline,
shape = quoteOutlineShape
)
}
.padding(dimensions().spacing4x)
.fillMaxWidth()
.height(IntrinsicSize.Min)
Expand All @@ -286,7 +286,7 @@
QuotedMessageTopRow(
senderName,
displayReplyArrow = style.quotedStyle == QuotedStyle.COMPLETE,
messageStyle = style.messageStyle
quotedMessageStyle = style
)
Row(horizontalArrangement = Arrangement.spacedBy(dimensions().spacing4x)) {
Column(
Expand Down Expand Up @@ -319,12 +319,16 @@
private fun QuotedMessageTopRow(
senderName: String?,
displayReplyArrow: Boolean,
messageStyle: MessageStyle
quotedMessageStyle: QuotedMessageStyle
) {

val messageStyle = quotedMessageStyle.messageStyle

val accentScheme = colorsScheme(quotedMessageStyle.senderAccent)

val authorColor = when (messageStyle) {
MessageStyle.BUBBLE_SELF -> colorsScheme().selfBubble.primaryOnSecondary
MessageStyle.BUBBLE_OTHER -> colorsScheme().otherBubble.primaryOnSecondary
MessageStyle.BUBBLE_SELF -> accentScheme.selfBubble.primaryOnSecondary
MessageStyle.BUBBLE_OTHER -> accentScheme.primary
MessageStyle.NORMAL -> colorsScheme().onSurfaceVariant
}

Expand Down Expand Up @@ -521,7 +525,7 @@
QuotedMessageTopRow(
senderName = senderName.asString(),
displayReplyArrow = true,
messageStyle = style.messageStyle
quotedMessageStyle = style
)
MainContentText(stringResource(R.string.notification_shared_picture))
QuotedMessageOriginalDate(originalDateTimeText, style)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.wire.android.ui.common.LegalHoldIndicator
import com.wire.android.ui.common.UserBadge
import com.wire.android.ui.common.applyIf
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.typography
import com.wire.android.ui.home.conversations.model.MessageHeader
import com.wire.android.ui.theme.Accent
import com.wire.android.ui.theme.wireColorScheme
Expand Down Expand Up @@ -106,7 +107,7 @@ fun MessageSmallLabel(
) {
Text(
text = text,
style = MaterialTheme.typography.labelSmall.copy(color = messageStyle.textColor()),
style = typography().subline01.copy(color = messageStyle.textColor()),
maxLines = 1,
modifier = modifier.alpha(messageStyle.alpha())
)
Expand Down
Loading
Loading