mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-11 10:40:54 +02:00
Fully removing the swipe to delete from right to left.
This commit is contained in:
parent
626daa9967
commit
e8462fe67f
@ -56,7 +56,6 @@ import com.vitorpamplona.amethyst.ui.stringRes
|
|||||||
fun SwipeToDeleteContainer(
|
fun SwipeToDeleteContainer(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onStartToEnd: () -> Unit,
|
onStartToEnd: () -> Unit,
|
||||||
onEndToStart: () -> Unit,
|
|
||||||
content: @Composable (RowScope.() -> Unit),
|
content: @Composable (RowScope.() -> Unit),
|
||||||
) {
|
) {
|
||||||
val dismissState =
|
val dismissState =
|
||||||
@ -66,9 +65,7 @@ fun SwipeToDeleteContainer(
|
|||||||
StartToEnd -> {
|
StartToEnd -> {
|
||||||
onStartToEnd()
|
onStartToEnd()
|
||||||
}
|
}
|
||||||
EndToStart -> {
|
EndToStart -> return@rememberSwipeToDismissBoxState false
|
||||||
onEndToStart()
|
|
||||||
}
|
|
||||||
Settled -> return@rememberSwipeToDismissBoxState false
|
Settled -> return@rememberSwipeToDismissBoxState false
|
||||||
}
|
}
|
||||||
return@rememberSwipeToDismissBoxState true
|
return@rememberSwipeToDismissBoxState true
|
||||||
@ -80,6 +77,7 @@ fun SwipeToDeleteContainer(
|
|||||||
state = dismissState,
|
state = dismissState,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
backgroundContent = { DismissBackground(dismissState) },
|
backgroundContent = { DismissBackground(dismissState) },
|
||||||
|
enableDismissFromEndToStart = false,
|
||||||
content = content,
|
content = content,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,6 @@ private fun DraftFeedLoaded(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.animateContentSize(),
|
.animateContentSize(),
|
||||||
onStartToEnd = { accountViewModel.delete(item) },
|
onStartToEnd = { accountViewModel.delete(item) },
|
||||||
onEndToStart = { },
|
|
||||||
) {
|
) {
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
item,
|
item,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user