Merge pull request #2078 from element-hq/feature/bma/reactionOffsetInDm

Reaction offset in dm
This commit is contained in:
Benoit Marty
2023-12-20 17:32:13 +01:00
committed by GitHub
68 changed files with 143 additions and 134 deletions

View File

@@ -48,7 +48,7 @@ import io.element.android.libraries.designsystem.theme.messageFromMeBackground
import io.element.android.libraries.designsystem.theme.messageFromOtherBackground
private val BUBBLE_RADIUS = 12.dp
private val BUBBLE_INCOMING_OFFSET = 16.dp
internal val BUBBLE_INCOMING_OFFSET = 16.dp
// Design says: The maximum width of a bubble is still 3/4 of the screen width. But try with 85% now.
private const val BUBBLE_WIDTH_RATIO = 0.85f

View File

@@ -345,7 +345,16 @@ private fun TimelineItemEventRowContent(
linkStartOrEnd(event)
}
.zIndex(1f)
.padding(start = if (event.isMine) 16.dp else 36.dp, end = 16.dp)
.padding(
// Note: due to the applied constraints, start is left for other's message and right for mine
// In design we want a offset of 6.dp compare to the bubble, so start is 22.dp (16 + 6)
start = when {
event.isMine -> 22.dp
timelineRoomInfo.isDirect -> 22.dp
else -> 22.dp + BUBBLE_INCOMING_OFFSET
},
end = 16.dp
)
)
}
}