Fix issue around modifier.
This commit is contained in:
parent
c796d064da
commit
eefc5d3bfe
2 changed files with 9 additions and 8 deletions
|
|
@ -38,9 +38,12 @@ import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
* @param swipeProgress the progress of the swipe, between 0 and X. When swipeProgress >= 1 the swipe will be detected.
|
* @param swipeProgress the progress of the swipe, between 0 and X. When swipeProgress >= 1 the swipe will be detected.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun RowScope.ReplySwipeIndicator(swipeProgress: Float) {
|
fun RowScope.ReplySwipeIndicator(
|
||||||
|
swipeProgress: Float,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.align(Alignment.CenterVertically)
|
.align(Alignment.CenterVertically)
|
||||||
.padding(start = 36.dp * swipeProgress.coerceAtMost(1f))
|
.padding(start = 36.dp * swipeProgress.coerceAtMost(1f))
|
||||||
.alpha(swipeProgress),
|
.alpha(swipeProgress),
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,6 @@ fun TimelineItemEventRow(
|
||||||
directions = setOf(DismissDirection.StartToEnd),
|
directions = setOf(DismissDirection.StartToEnd),
|
||||||
dismissContent = {
|
dismissContent = {
|
||||||
TimelineItemEventRowContent(
|
TimelineItemEventRowContent(
|
||||||
modifier = Modifier,
|
|
||||||
event = event,
|
event = event,
|
||||||
isHighlighted = isHighlighted,
|
isHighlighted = isHighlighted,
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
|
|
@ -145,13 +144,12 @@ fun TimelineItemEventRow(
|
||||||
onTimestampClicked = onTimestampClicked,
|
onTimestampClicked = onTimestampClicked,
|
||||||
inReplyToClicked = ::inReplyToClicked,
|
inReplyToClicked = ::inReplyToClicked,
|
||||||
onUserDataClicked = ::onUserDataClicked,
|
onUserDataClicked = ::onUserDataClicked,
|
||||||
onReactionClicked = ::onReactionClicked
|
onReactionClicked = ::onReactionClicked,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
TimelineItemEventRowContent(
|
TimelineItemEventRowContent(
|
||||||
modifier = Modifier,
|
|
||||||
event = event,
|
event = event,
|
||||||
isHighlighted = isHighlighted,
|
isHighlighted = isHighlighted,
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
|
|
@ -160,7 +158,7 @@ fun TimelineItemEventRow(
|
||||||
onTimestampClicked = onTimestampClicked,
|
onTimestampClicked = onTimestampClicked,
|
||||||
inReplyToClicked = ::inReplyToClicked,
|
inReplyToClicked = ::inReplyToClicked,
|
||||||
onUserDataClicked = ::onUserDataClicked,
|
onUserDataClicked = ::onUserDataClicked,
|
||||||
onReactionClicked = ::onReactionClicked
|
onReactionClicked = ::onReactionClicked,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// This is assuming that we are in a ColumnScope, but this is OK, for both Preview and real usage.
|
// This is assuming that we are in a ColumnScope, but this is OK, for both Preview and real usage.
|
||||||
|
|
@ -173,7 +171,6 @@ fun TimelineItemEventRow(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun TimelineItemEventRowContent(
|
private fun TimelineItemEventRowContent(
|
||||||
modifier: Modifier,
|
|
||||||
event: TimelineItem.Event,
|
event: TimelineItem.Event,
|
||||||
isHighlighted: Boolean,
|
isHighlighted: Boolean,
|
||||||
interactionSource: MutableInteractionSource,
|
interactionSource: MutableInteractionSource,
|
||||||
|
|
@ -182,7 +179,8 @@ private fun TimelineItemEventRowContent(
|
||||||
onTimestampClicked: (TimelineItem.Event) -> Unit,
|
onTimestampClicked: (TimelineItem.Event) -> Unit,
|
||||||
inReplyToClicked: () -> Unit,
|
inReplyToClicked: () -> Unit,
|
||||||
onUserDataClicked: () -> Unit,
|
onUserDataClicked: () -> Unit,
|
||||||
onReactionClicked: (emoji: String) -> Unit
|
onReactionClicked: (emoji: String) -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
// To avoid using negative offset, we display in this Box a column with:
|
// To avoid using negative offset, we display in this Box a column with:
|
||||||
// - Spacer to give room to the Sender information if they must be displayed;
|
// - Spacer to give room to the Sender information if they must be displayed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue