Skip to content

Commit

Permalink
refactor: Streamline configuration usage logic
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Nov 27, 2024
1 parent e51a035 commit a9a178d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fun SwipeToDismissComponent(
// // TODO: This check triggers twice, why ?? :(
// if (shouldDismiss) {
// Log.i("TOTO", "SwipeToDismiss state : $value")
// // TODO: We should probably add an animation here
// onSwiped()
// } else {
// Log.d("TOTO", "SwipeToDismiss state : $value")
Expand All @@ -81,17 +80,16 @@ fun SwipeToDismissComponent(
// TODO: Sometimes, this check triggers several times in a row, why ?
if (state.currentValue == SwipeToDismissBoxValue.EndToStart) {
Log.i("TOTO", "SwipeToDismiss state : EndToStart")
// TODO: We should probably add an animation here
onSwiped()
}

// TODO: Red & Gray dark theme background colors need to be handled
val backgroundColor by animateColorAsState(
targetValue = if (state.targetValue == SwipeToDismissBoxValue.Settled) defaultColor else swipedColor,
targetValue = if (state.targetValue == SwipeToDismissBoxValue.EndToStart) swipedColor else defaultColor,
label = "Background color animation",
)
val iconScale by animateFloatAsState(
targetValue = if (state.targetValue == SwipeToDismissBoxValue.Settled) minIconScale else maxIconScale,
targetValue = if (state.targetValue == SwipeToDismissBoxValue.EndToStart) maxIconScale else minIconScale,
label = "Icon scale animation",
)
val contentElevation by animateDpAsState(
Expand Down

0 comments on commit a9a178d

Please sign in to comment.