Skip to content

Commit 8de74e5

Browse files
committed
Fix RTL with open PR
- saket/swipe#33
1 parent dc01f61 commit 8de74e5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

app/src/main/java/com/capyreader/app/ui/articles/list/ArticleRowSwipeBox.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ fun ArticleRowSwipeBox(
1414

1515
if (swipeState.disabled) {
1616
content()
17-
}
18-
19-
SwipeableActionsBox(
20-
startActions = swipeState.start,
21-
endActions = swipeState.end,
22-
backgroundUntilSwipeThreshold = MaterialTheme.colorScheme.surface
23-
) {
24-
content()
17+
} else {
18+
SwipeableActionsBox(
19+
startActions = swipeState.start,
20+
endActions = swipeState.end,
21+
backgroundUntilSwipeThreshold = MaterialTheme.colorScheme.surface
22+
) {
23+
content()
24+
}
2525
}
2626
}

app/src/main/java/me/saket/swipe/SwipeableActionsBox.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ private fun ActionIconBox(
125125
layout(width = placeable.width, height = placeable.height) {
126126
// Align icon with the left/right edge of the content being swiped.
127127
val iconOffset = if (action.isOnRightSide) constraints.maxWidth + offset else offset - placeable.width
128-
placeable.placeRelative(x = iconOffset.roundToInt(), y = 0)
128+
placeable.place(x = iconOffset.roundToInt(), y = 0)
129129
}
130130
}
131131
.background(color = backgroundColor),
132-
horizontalArrangement = if (action.isOnRightSide) Arrangement.Start else Arrangement.End,
132+
horizontalArrangement = if (action.isOnRightSide) Arrangement.Absolute.Left else Arrangement.Absolute.Right,
133133
verticalAlignment = Alignment.CenterVertically,
134134
) {
135135
content()

0 commit comments

Comments
 (0)