refactor: unify swipe reset to snap before clearing offset
Snap the Animatable first, clear rawOffset after - no frame with the row still translated while the delete affordance is hidden.
This commit is contained in:
@@ -111,8 +111,8 @@ fun DictionaryListItem(
|
||||
snapshotFlow { isDeleteBlockedCurrent() }
|
||||
.collect { blocked ->
|
||||
if (blocked) {
|
||||
offsetAnim.snapTo(0f)
|
||||
rawOffset = 0f
|
||||
scope.launch { offsetAnim.snapTo(0f) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,8 +271,10 @@ fun DictionaryListItem(
|
||||
onClick = {
|
||||
haptic.performHapticFeedback(HapticFeedbackType.TextHandleMove)
|
||||
currentOnDelete()
|
||||
scope.launch { offsetAnim.snapTo(0f) }
|
||||
scope.launch {
|
||||
offsetAnim.snapTo(0f)
|
||||
rawOffset = 0f
|
||||
}
|
||||
},
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterEnd)
|
||||
|
||||
Reference in New Issue
Block a user