Added StackAnimator.inverted extension function#993
Added StackAnimator.inverted extension function#993arkivanov merged 4 commits intoarkivanov:masterfrom
Conversation
📝 WalkthroughWalkthroughAdded a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt`:
- Around line 14-24: The public API has changed for function
slide(animationSpec:..., orientation:..., reverseDirection: Boolean = false) in
Slide.kt but the API dump files were not regenerated; run the Gradle task that
regenerates API dumps (e.g., the project's API dump/validate task) so the
updated signature for slide (including the reverseDirection parameter) is
written into the extensions-compose-experimental API dump files, then commit the
updated dump files.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f85aacfb-35e2-4db2-8a6f-73d503c81356
📒 Files selected for processing (1)
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt
...Main/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt
Show resolved
Hide resolved
|
Thanks! I think this could be done in a more generic way. And we could also avoid changing the existing API. Let me know what do you think. Also, don't forget to update API dump files: @ExperimentalDecomposeApi
fun StackAnimator.inverted(): StackAnimator =
StackAnimator { direction ->
animate(
direction = when (direction) {
Direction.ENTER_FRONT -> Direction.ENTER_BACK
Direction.EXIT_FRONT -> Direction.EXIT_BACK
Direction.ENTER_BACK -> Direction.ENTER_FRONT
Direction.EXIT_BACK -> Direction.EXIT_FRONT
},
)
}
|
|
Thanks! I agree your solution is better and cleaner. My apologies for missing the doc comments regarding negative values for the factor in different directions. |
This reverts commit 7235532
Added doc comment pointed to StackAnimator.inverted() to Slide.kt Dumped api files
|
Thank you! |
Add extra parameter to reverse slide animation direction.
Summary by CodeRabbit