Skip to content

Commit

Permalink
Fix RTL with open PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Oct 20, 2024
1 parent dc01f61 commit 8de74e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ fun ArticleRowSwipeBox(

if (swipeState.disabled) {
content()
}

SwipeableActionsBox(
startActions = swipeState.start,
endActions = swipeState.end,
backgroundUntilSwipeThreshold = MaterialTheme.colorScheme.surface
) {
content()
} else {
SwipeableActionsBox(
startActions = swipeState.start,
endActions = swipeState.end,
backgroundUntilSwipeThreshold = MaterialTheme.colorScheme.surface
) {
content()
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/me/saket/swipe/SwipeableActionsBox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ private fun ActionIconBox(
layout(width = placeable.width, height = placeable.height) {
// Align icon with the left/right edge of the content being swiped.
val iconOffset = if (action.isOnRightSide) constraints.maxWidth + offset else offset - placeable.width
placeable.placeRelative(x = iconOffset.roundToInt(), y = 0)
placeable.place(x = iconOffset.roundToInt(), y = 0)
}
}
.background(color = backgroundColor),
horizontalArrangement = if (action.isOnRightSide) Arrangement.Start else Arrangement.End,
horizontalArrangement = if (action.isOnRightSide) Arrangement.Absolute.Left else Arrangement.Absolute.Right,
verticalAlignment = Alignment.CenterVertically,
) {
content()
Expand Down

0 comments on commit 8de74e5

Please sign in to comment.