getMessageBubbleShape

fun getMessageBubbleShape(cornerRadius: Dp, isSender: Boolean, hasSamePrev: Boolean = false, hasSameNext: Boolean = false, groupedCornerRadius: Dp = 4.dp): CornerBasedShape(source)

Returns a CornerBasedShape for a message bubble based on its position in a sequence.

Standalone bubbles are fully rounded; consecutive bubbles from the same sender flatten only the corners facing each other (to groupedCornerRadius) so a run reads as one visual group, matching the M3 conversation pattern.

Parameters

cornerRadius

The base corner radius for the bubble.

isSender

Whether the message was sent by the local user.

hasSamePrev

Whether the previous message in the list is from the same sender.

hasSameNext

Whether the next message in the list is from the same sender.

groupedCornerRadius

The reduced radius used on corners adjacent to a same-sender neighbor.