-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new stack animation API with shared transitions support #753
Conversation
WalkthroughThe recent updates introduce a comprehensive framework for managing stack animations in Jetpack Compose applications using the Decompose library. Key enhancements include new classes and interfaces for animation control, utilities for managing child stacks, and improved composable functions. These changes provide developers with essential tools to implement smooth transitions between UI components, facilitating a more dynamic user experience. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range, codebase verification and nitpick comments (3)
extensions-compose/build.gradle.kts (1)
Verify the impact of removing
kotlinxCoroutinesCore
.The
kotlinx.coroutines
package is still being used in multiple files across the codebase. The removal of thekotlinxCoroutinesCore
dependency fromcommon.main.dependencies
may lead to build issues or runtime errors. Please ensure that this dependency is either replaced or no longer required.
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt
sample/shared/compose/src/jvmTest/kotlin/com/arkivanov/sample/shared/counters/counter/CounterContentTest.kt
sample/app-desktop/src/jvmMain/kotlin/com/arkivanov/sample/app/Main.kt
extensions-compose/src/jvmMain/kotlin/com/arkivanov/decompose/extensions/compose/lifecycle/LifecycleController.kt
decompose/src/nonWebTest/kotlin/com/arkivanov/decompose/AbstractThreadingTest.kt
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/predictiveback/AndroidPredictiveBackAnimatable.kt
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/predictiveback/PredictiveBackAnimation.kt
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/predictiveback/MaterialPredictiveBackAnimatable.kt
Analysis chain
Line range hint
31-31
:
Verify the impact of removingkotlinxCoroutinesCore
.The removal of the
kotlinxCoroutinesCore
dependency suggests a shift in the project's dependency management. Ensure that the functionality related to coroutine support is not negatively impacted.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `kotlinxCoroutinesCore` in the codebase. # Test: Search for the usage of `kotlinx.coroutines` package. Expect: No remaining usages if the dependency is truly no longer required. rg --type kotlin -A 5 $'kotlinx.coroutines'Length of output: 11051
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimator.kt (1)
1-2
: Add a file-level KDoc comment.Consider adding a KDoc comment at the top of the file to describe the purpose and usage of this class.
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (1)
3-4
: Remove unused import.The
import androidx.compose.animation.AnimatedVisibility
is not used in this function.- import androidx.compose.animation.AnimatedVisibility
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (30)
- extensions-compose-experimental/.gitignore (1 hunks)
- extensions-compose-experimental/api/android/extensions-compose-experimental.api (1 hunks)
- extensions-compose-experimental/api/extensions-compose-experimental.klib.api (1 hunks)
- extensions-compose-experimental/api/jvm/extensions-compose-experimental.api (1 hunks)
- extensions-compose-experimental/build.gradle.kts (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/SimpleAnimatedVisibilityScope.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/Utils.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimator.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/EmptyStackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Fade.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/PredictiveBackParams.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Scale.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationProvider.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimator.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStackTest.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/GetFadeAlphaTest.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt (1 hunks)
- extensions-compose/build.gradle.kts (1 hunks)
- extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt (3 hunks)
- sample/shared/compose/build.gradle.kts (2 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (1 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (4 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt (4 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/DefaultSharedTransitionsComponent.kt (1 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsComponent.kt (1 hunks)
- settings.gradle.kts (1 hunks)
Files skipped from review due to trivial changes (1)
- extensions-compose-experimental/.gitignore
Additional comments not posted (118)
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/Utils.kt (1)
8-8
: LGTM!The code changes are approved.
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationProvider.kt (2)
7-9
: LGTM!The code changes are approved.
11-17
: LGTM!The code changes are approved.
sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsComponent.kt (2)
9-13
: LGTM!The code changes are approved.
Line range hint
14-19
:
No changes detected.No review comments are necessary for unchanged code.
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/SimpleAnimatedVisibilityScope.kt (2)
18-20
: LGTM!The implementation of
SimpleAnimatedVisibilityScope
is correct.
9-16
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
WithAnimatedVisibilityScope
are used correctly.Verification successful
Function usage verified!
The function
WithAnimatedVisibilityScope
is used correctly in the following files:
EmptyStackAnimation.kt
DefaultStackAnimation.kt
Both instances correctly pass the
transition
parameter and use the composable block as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `WithAnimatedVisibilityScope`. # Test: Search for the function usage. Expect: Correct usage of the function. rg --type kotlin -A 5 $'WithAnimatedVisibilityScope'Length of output: 5956
Script:
#!/bin/bash # Extract relevant code snippets from EmptyStackAnimation.kt and DefaultStackAnimation.kt to verify the correct usage of WithAnimatedVisibilityScope. # Extract code from EmptyStackAnimation.kt echo "Code from EmptyStackAnimation.kt:" rg --type kotlin -A 10 -B 10 'WithAnimatedVisibilityScope' extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/EmptyStackAnimation.kt # Extract code from DefaultStackAnimation.kt echo "Code from DefaultStackAnimation.kt:" rg --type kotlin -A 10 -B 10 'WithAnimatedVisibilityScope' extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.ktLength of output: 3901
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Scale.kt (1)
13-27
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
scale
are used correctly.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Fade.kt (2)
24-25
: LGTM!The implementation of
getFadeAlpha
is correct.
15-22
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
fade
are used correctly.Verification successful
Function
fade
is used correctly in the codebase.The usages of the
fade
function across the codebase are consistent with its intended purpose of providing a fading animation. The function is used appropriately in both test cases and main code.
- Verified in files:
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.kt
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStackTest.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DynamicFeaturesContent.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/tabs/TabsContent.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/root/RootContent.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/dynamicfeature/DynamicFeatureContent.kt
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/CountersContent.kt
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimation.kt
extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/ChildrenTest.kt
extensions-compose/src/nonAndroidMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/predictiveback/PredictiveBackGestureOverlay.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `fade`. # Test: Search for the function usage. Expect: Correct usage of the function. rg --type kotlin -A 5 $'fade'Length of output: 28500
Script:
#!/bin/bash # Description: Gather detailed context around the usages of the `fade` function to verify its correct usage. # Search for the function usage and include more context lines to understand the usage better. rg --type kotlin -A 10 -B 2 $'fade()'Length of output: 53677
settings.gradle.kts (1)
31-31
: LGTM! The new module inclusion is correct.The addition of the new module
extensions-compose-experimental
is consistent with the existing module inclusions.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/PredictiveBackParams.kt (1)
1-30
: LGTM! The classPredictiveBackParams
is well-defined.The class contains clear documentation and correctly defined parameters for the predictive back gesture.
extensions-compose-experimental/build.gradle.kts (6)
1-7
: Imports look good.The import statements are concise and relevant to the build configuration.
9-15
: Plugin setup is appropriate.The necessary plugins for Kotlin multiplatform, Android, and Compose are included.
17-24
: Multiplatform setup is comprehensive.The multiplatform setup includes targets for Android, JVM, macOS, iOS, JavaScript, and WebAssembly.
26-27
: Publication and binary compatibility setup is appropriate.The setup for publication and binary compatibility validation is included.
29-31
: Android namespace is correctly defined.The Android namespace is set appropriately for the new module.
33-55
: Source sets and dependencies are well-defined.The source sets and dependencies for common and JVM targets are correctly set up. The use of
optIn
for internal APIs is also noted.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt (5)
1-1
: Package declaration is appropriate.The package declaration follows the standard naming conventions.
3-9
: Imports and annotation are appropriate.The necessary imports for animation, gestures, and layout are included. The use of
@ExperimentalDecomposeApi
annotation is noted.
10-23
: Slide animation function is well-defined.The
slide
function provides a configurable sliding animation for stack transitions. The use ofFiniteAnimationSpec
andOrientation
parameters allows flexibility.
25-32
: Horizontal offset calculation is correct.The
offsetXFactor
function correctly calculates the horizontal offset for the sliding animation.
34-41
: Vertical offset calculation is correct.The
offsetYFactor
function correctly calculates the vertical offset for the sliding animation.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/EmptyStackAnimation.kt (5)
1-1
: Package declaration is appropriate.The package declaration follows the standard naming conventions.
3-15
: Imports and annotation are appropriate.The necessary imports for animation, layout, and runtime are included. The use of
@ExperimentalDecomposeApi
annotation is noted.
16-18
: Empty stack animation function is well-defined.The
emptyStackAnimation
function provides a way to create an empty stack animation.
20-24
: Comment provides useful context.The comment explains why the class cannot be anonymous, referencing relevant GitHub issues.
26-43
: EmptyStackAnimation class is correctly implemented.The
EmptyStackAnimation
class implements theStackAnimation
interface and provides a composable function for the animation. The use ofMutableTransitionState
andrememberTransition
is appropriate for managing the animation state.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimator.kt (3)
3-7
: Imports are appropriate.The imports are relevant and necessary for the functionality provided in this file.
15-19
: Class and constructor definition looks good.The
DefaultStackAnimator
class is defined with an appropriate constructor and default parameter values.
21-40
: Ensure proper handling ofEnterExitState
cases.The
animate
function handlesEnterExitState
cases correctly. Ensure that all possible states are covered and handled as expected.sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt (5)
3-3
: EnsureAnimatedVisibility
import is necessary.The import for
AnimatedVisibility
is necessary for the new visibility mechanism.
4-4
: EnsureAnimatedVisibilityScope
import is necessary.The import for
AnimatedVisibilityScope
is necessary for the new visibility mechanism.
25-25
: Parameter change is appropriate.The parameter change from
isVisible: Boolean
toanimatedVisibilityScope: AnimatedVisibilityScope
is appropriate for the new visibility mechanism.
35-37
: EnsuresharedElement
function handlesanimatedVisibilityScope
correctly.The
sharedElement
function now usesanimatedVisibilityScope
. Ensure that this change is handled correctly within the function.
52-58
: Usage ofAnimatedVisibility
is correct.The usage of
AnimatedVisibility
in thePhotoContentPreview
function is correct and aligns with the new parameter structure.sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/DefaultSharedTransitionsComponent.kt (1)
53-55
: NewonBack
method implementation looks good.The
onBack
method correctly callsnav.pop()
to handle back navigation.sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (5)
10-16
: LGTM! New imports are necessary and correctly used.The new imports for experimental APIs from the
decompose
library are appropriate and correctly utilized in the code.
22-22
: LGTM! Opt-in for experimental APIs is appropriate.The opt-in for
ExperimentalSharedTransitionApi
andExperimentalDecomposeApi
is necessary for using the experimental features.
29-38
: LGTM! Enhanced state management and animation handling.The transition from
Children
toChildStack
and the introduction ofPredictiveBackParams
improve state management and animation handling.
44-44
: LGTM! Correct usage ofanimatedVisibilityScope
.The use of
animatedVisibilityScope
enhances the animation capabilities forGalleryContent
.
51-51
: LGTM! Correct usage ofanimatedVisibilityScope
.The use of
animatedVisibilityScope
enhances the animation capabilities forPhotoContent
.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimator.kt (3)
1-24
: LGTM! Well-definedStackAnimator
interface.The
StackAnimator
interface is well-defined and provides a clear contract for animating child widgets.
27-45
: LGTM! UsefulstackAnimator
function.The
stackAnimator
function provides a convenient way to createStackAnimator
implementations with frame-by-frame rendering.
48-72
: LGTM! Usefulplus
operator for combining animators.The
plus
operator allows combining multipleStackAnimator
instances, enhancing flexibility.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.kt (3)
1-23
: LGTM! Well-definedStackAnimation
interface.The
StackAnimation
interface is well-defined and provides a clear contract for animating between child widgets.
26-42
: LGTM! UsefulstackAnimation
function with selector.The
stackAnimation
function with a selector provides flexibility in choosing differentStackAnimator
instances for different children and directions.
45-61
: LGTM! UsefulstackAnimation
function with default animator.The
stackAnimation
function with a default animator simplifies the creation ofStackAnimation
instances with common animation behaviors.sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (3)
29-31
: LGTM!The new parameter
animatedVisibilityScope
is correctly used for shared element transitions.
62-68
: LGTM!The
GalleryContentPreview
function correctly usesAnimatedVisibility
to wrapGalleryContent
with the newanimatedVisibilityScope
parameter.
45-47
: EnsurerememberSharedContentState
is defined and used correctly.Verify that
rememberSharedContentState
correctly handles theanimatedVisibilityScope
parameter.sample/shared/compose/build.gradle.kts (1)
61-61
: LGTM!The new dependency
implementation(project(":extensions-compose-experimental"))
is correctly added for experimental shared transitions.extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/GetFadeAlphaTest.kt (2)
8-59
: LGTM!The test cases comprehensively cover various scenarios for the
getFadeAlpha
function.
61-74
: LGTM!The
getFadeAlpha_allCases
test function correctly tests all cases for thegetFadeAlpha
function.extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt (6)
68-82
: Ensure state subscription logic is correct.The function subscribes to the stack state using
subscribeAsState
. Verify that the state subscription is correctly set up and managed.Verification successful
State subscription logic is correctly set up.
The function
ChildStack
subscribes to the state usingsubscribeAsState
and uses this state to call anotherChildStack
function. This pattern is consistent with other usages in the codebase, confirming that the state subscription logic is correctly set up and managed.
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt
(line 68)Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the state subscription is correctly set up and managed. # Test: Search for the usage of `subscribeAsState`. Expect: It should be correctly set up and managed. rg --type kotlin -A 5 $'subscribeAsState'Length of output: 22001
84-86
: Ensure key generation logic is correct.The function generates a set of keys for the child stack. Verify that the keys are correctly generated and unique.
Verification successful
Ensure key generation logic is correct.
The
keyHashString
function is designed to generate unique keys, as evidenced by its implementation and the associated test cases.
- Implementation:
decompose/src/commonMain/kotlin/com/arkivanov/decompose/Utils.kt
- Test cases:
decompose/src/commonTest/kotlin/com/arkivanov/decompose/KeyHashStringTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the keys are correctly generated and unique. # Test: Search for the usage of `keyHashString` to ensure it generates unique keys. rg --type kotlin -A 5 $'keyHashString'Length of output: 11433
87-102
: Ensure state retention logic is correct.The function retains the states of the current keys. Verify that the state retention logic is correctly handled and optimized.
Verification successful
State retention logic is correctly handled and optimized.
The
retainStates
function is used consistently in the codebase, ensuring that states not in the current keys are removed. The logic appears to be correctly handled and optimized.
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/Children.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the state retention logic is correctly handled and optimized. # Test: Search for the usage of `retainStates`. Expect: It should be correctly handled and optimized. rg --type kotlin -A 5 $'retainStates'Length of output: 3839
34-52
: EnsureLocalStackAnimationProvider
is correctly provided.The function uses
LocalStackAnimationProvider
to obtain the default animation if none is provided. Verify thatLocalStackAnimationProvider
is correctly set up in the parent composable.
40-42
: Ensure state retention logic is correct.The function uses
rememberSaveableStateHolder
to retain states. Verify that the keys used for state retention are unique and consistent.
71-73
: Ensure animation parameters are correctly handled.The function passes the animation parameter to the previous
ChildStack
function. Verify that the animation parameters are correctly handled and passed.Verification successful
The
ChildStack
function definitions were found inChildStack.kt
:
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt
The
animation
parameter is correctly handled and passed within theChildStack
function. The implementation ensures that theanimation
parameter is used appropriately, either directly or passed to other functions.Locations:
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the animation parameters are correctly handled and passed. # Test: Search for the usage of `animation` parameter. Expect: It should be correctly handled and passed. rg --type kotlin -A 5 $'animation'Length of output: 165917
Script:
#!/bin/bash # Description: Verify the implementation of the ChildStack function and how the animation parameter is handled. # Search for the implementation of the ChildStack function in the repository ast-grep --lang kotlin --pattern $'@Composable\nfun <C : Any, T : Any> ChildStack(stack: $_, animation: $_, content: $_) { $$$ }'Length of output: 129
Script:
#!/bin/bash # Description: Verify the implementation of the ChildStack function and how the animation parameter is handled. # Search for the definition of the ChildStack function in the repository rg --type kotlin -A 10 'fun <C : Any, T : Any> ChildStack('Length of output: 180
Script:
#!/bin/bash # Description: Verify the implementation of the ChildStack function and how the animation parameter is handled. # Search for the definition of the ChildStack function in the repository with corrected regex pattern rg --type kotlin -A 10 'fun <C : Any, T : Any> ChildStack\('Length of output: 3672
extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt (4)
Line range hint
31-60
:
Ensure correct integration and validation of the new data structure.The
test
function now uses aHashMap
namedresults
for tracking directions. Verify that the new data structure is correctly integrated and validated.Verification successful
Ensure correct integration and validation of the new data structure.
The
test
function now uses aHashMap
namedresults
for tracking directions. The integration and validation of this data structure appear to be consistent. Theresults
data structure is correctly initialized, used, cleared, and validated against the expected values.
- The
results
data structure is initialized and used to store directions.- It is cleared before updating the stack.
- The final assertion checks the
results
against the expected values.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new data structure. # Test: Search for the usage of `results` to ensure it is correctly integrated and validated. rg --type kotlin -A 5 $'results'Length of output: 17134
Line range hint
76-98
:
Ensure correct integration and validation of the new expected data structure.The
getParameters
function returns a list ofParams
with the new expected data structure. Verify that the new data structure is correctly integrated and validated.Verification successful
Ensure correct integration and validation of the new expected data structure.
The
expected
field within theParams
class is correctly integrated and validated through assertions in the test files.
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt
extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new expected data structure. # Test: Search for the usage of `expected` to ensure it is correctly integrated and validated. rg --type kotlin -A 5 $'expected'Length of output: 46299
100-104
: Ensure correct integration and validation of the new data structure inParams
.The
Params
class now uses aMap
for the expected data structure. Verify that the new data structure is correctly integrated and validated.Verification successful
Ensure correct integration and validation of the new data structure in
Params
.The
Params
class has been correctly updated to use aMap
for the expected data structure. The new structure is integrated and validated in the test cases where instances ofParams
are created with the expected values.
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt
extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new data structure in `Params`. # Test: Search for the usage of `Params` to ensure it is correctly integrated and validated. rg --type kotlin -A 5 $'Params'Length of output: 40120
Line range hint
61-65
:
Ensure correctness of thestack
function.The
stack
function sets up the child stack configurations. Verify that it correctly sets up the configurations.Verification successful
Ensure correctness of the
stack
function.The
stack
function correctly sets up the child stack configurations by assigning the last element as the active child and the rest as the back stack. This setup is used in multiple places within the test file to initialize the stack for testing animation directions.
- The function assigns the last element of the
configs
list as the active child.- The remaining elements are assigned to the back stack.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the `stack` function. # Test: Search for the usage of `stack` to ensure it correctly sets up the configurations. rg --type kotlin -A 5 $'stack'Length of output: 434062
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt (4)
31-59
: Ensure correct integration and validation of the new data structure and animation.The
test
function uses aHashMap
namedresults
for tracking directions andDefaultStackAnimation
for animations. Verify that the new data structure and animation are correctly integrated and validated.Verification successful
Integration and validation of the new data structure and animation are correctly handled.
The
test
function inStackAnimationDirectionsTest.kt
correctly integrates and validates theresults
data structure andDefaultStackAnimation
. The usage is consistent with other test cases.
results
is used to track directions.DefaultStackAnimation
is instantiated with appropriate parameters.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new data structure and animation. # Test: Search for the usage of `results` and `DefaultStackAnimation` to ensure they are correctly integrated and validated. rg --type kotlin -A 5 $'results' rg --type kotlin -A 5 $'DefaultStackAnimation'Length of output: 21630
76-98
: Ensure correct integration and validation of the new expected data structure.The
getParameters
function returns a list ofParams
with the new expected data structure. Verify that the new data structure is correctly integrated and validated.Verification successful
The new expected data structure is correctly integrated and validated.
The
expected
field in theParams
class is used in assertions within the test file to ensure the results match the expected output, confirming proper integration and validation.
- File:
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt
- Line: 76-98
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new expected data structure. # Test: Search for the usage of `expected` to ensure it is correctly integrated and validated. rg --type kotlin -A 5 $'expected'Length of output: 46299
100-104
: Ensure correct integration and validation of the new data structure inParams
.The
Params
class uses aMap
for the expected data structure. Verify that the new data structure is correctly integrated and validated.Verification successful
Integration and validation of the new data structure in
Params
is correct.The
Params
class, which uses aMap
for the expected data structure, is correctly integrated and validated within theStackAnimationDirectionsTest.kt
file. The usage within thegetParameters
function and as a private property confirms its proper implementation.
extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and validation of the new data structure in `Params`. # Test: Search for the usage of `Params` to ensure it is correctly integrated and validated. rg --type kotlin -A 5 $'Params'Length of output: 40120
61-65
: Ensure correctness of thestack
function.The
stack
function sets up the child stack configurations. Verify that it correctly sets up the configurations.Verification successful
Ensure correctness of the
stack
function.The
stack
function sets up the child stack configurations. The verification of its correctness is supported by its usage in theStackAnimationDirectionsTest.kt
file and the extensive use ofChildStack
in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the `stack` function. # Test: Search for the usage of `stack` to ensure it correctly sets up the configurations. rg --type kotlin -A 5 $'stack'Length of output: 434062
extensions-compose-experimental/api/android/extensions-compose-experimental.api (11)
2-3
: Ensure proper usage of Composer parameters.The functions
ChildStack
takeComposer
parameters. Ensure that these parameters are correctly used and managed to avoid any runtime issues.
7-8
: Ensure proper usage of synthetic functions.The functions
fade
andfade$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
13-17
: Ensure proper initialization and usage of back handler functions.The constructor and getter functions for back handler and animatable selector must be correctly initialized and used to avoid any runtime issues.
21-22
: Ensure proper usage of synthetic functions.The functions
scale
andscale$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
26-27
: Ensure proper usage of synthetic functions.The functions
slide
andslide$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
31-31
: Ensure proper implementation of the abstract function.The abstract function
invoke
must be correctly implemented in the derived classes to avoid any runtime issues.
35-38
: Ensure proper usage of synthetic functions.The functions
stackAnimation
andstackAnimation$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
42-42
: Ensure proper implementation of the abstract function.The abstract function
provide
must be correctly implemented in the derived classes to avoid any runtime issues.
46-46
: Ensure proper usage of the function.The function
getLocalStackAnimationProvider
must be correctly used to avoid any runtime issues.
50-50
: Ensure proper implementation of the abstract function.The abstract function
animate
must be correctly implemented in the derived classes to avoid any runtime issues.
54-56
: Ensure proper usage of synthetic functions.The functions
plus
,stackAnimator
, andstackAnimator$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.extensions-compose-experimental/api/jvm/extensions-compose-experimental.api (11)
2-3
: Ensure proper usage of Composer parameters.The functions
ChildStack
takeComposer
parameters. Ensure that these parameters are correctly used and managed to avoid any runtime issues.
7-8
: Ensure proper usage of synthetic functions.The functions
fade
andfade$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
13-17
: Ensure proper initialization and usage of back handler functions.The constructor and getter functions for back handler and animatable selector must be correctly initialized and used to avoid any runtime issues.
21-22
: Ensure proper usage of synthetic functions.The functions
scale
andscale$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
26-27
: Ensure proper usage of synthetic functions.The functions
slide
andslide$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
31-31
: Ensure proper implementation of the abstract function.The abstract function
invoke
must be correctly implemented in the derived classes to avoid any runtime issues.
35-38
: Ensure proper usage of synthetic functions.The functions
stackAnimation
andstackAnimation$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.
42-42
: Ensure proper implementation of the abstract function.The abstract function
provide
must be correctly implemented in the derived classes to avoid any runtime issues.
46-46
: Ensure proper usage of the function.The function
getLocalStackAnimationProvider
must be correctly used to avoid any runtime issues.
50-50
: Ensure proper implementation of the abstract function.The abstract function
animate
must be correctly implemented in the derived classes to avoid any runtime issues.
54-56
: Ensure proper usage of synthetic functions.The functions
plus
,stackAnimator
, andstackAnimator$default
are synthetic functions. Ensure that these functions are correctly used and managed to avoid any runtime issues.extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStackTest.kt (6)
41-47
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario. Ensure that edge cases, such as null or invalid states, are also covered.
50-57
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario. Ensure that edge cases, such as null or invalid states, are also covered.
60-67
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario. Ensure that edge cases, such as null or invalid states, are also covered.
70-78
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario. Ensure that edge cases, such as null or invalid states, are also covered.
81-90
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario. Ensure that edge cases, such as null or invalid states, are also covered.
93-102
: Ensure proper test coverage for edge cases.The test function verifies the basic scenario
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt (12)
37-41
: Constructor and Class-Level Properties Look GoodThe constructor initializes necessary properties for
DefaultStackAnimation
, includingdisableInputDuringAnimation
,predictiveBackParams
, andselector
. These properties are essential for managing stack animations and predictive back gestures.
96-115
: Child Composable Function Looks GoodThe
Child
composable function handles the animation of individual child components. It usesrememberTransition
andWithAnimatedVisibilityScope
to manage the visibility and animation states. The use ofLaunchedEffect
to triggeronFinished
is appropriate.
161-184
: PredictiveBackController Composable Function Looks GoodThe
PredictiveBackController
composable function manages the predictive back gestures using aDisposableEffect
to register and unregister the back callback. The use ofrememberCoroutineScope
andPredictiveBackCallback
is appropriate.
186-199
: AnimationItem Factory Function Looks GoodThe
AnimationItem
factory function creates animation items with the appropriate animator. The use of theselector
function to determine the animator is appropriate.
284-296
: Overlay Composable Function Looks GoodThe
Overlay
composable function creates a box that consumes pointer events to disable input during animations. The use ofpointerInput
andawaitPointerEventScope
is appropriate.
298-304
: AnimationItem Data Class Looks GoodThe
AnimationItem
data class holds the properties for each animation item, including the child, direction, transition state, and animator. The use of default values is appropriate.
306-309
: keyedItemsOf Utility Function Looks GoodThe
keyedItemsOf
utility function creates a map of animation items keyed by the child's key. The use ofassociateBy
is appropriate.
315-322
: SimpleStackAnimator Class Looks GoodThe
SimpleStackAnimator
class implements theStackAnimator
interface and provides a simple way to apply a modifier for animations. The use of a lambda to provide the modifier is appropriate.
324-327
: transitionTo Extension Function Looks GoodThe
transitionTo
extension function creates aMutableTransitionState
and sets the target state. The use ofapply
is appropriate.
330-335
: isIdle Extension Function Looks GoodThe
isIdle
extension function checks if aTransitionState
is idle. The logic is clear and appropriate.
43-94
: Ensure Proper Handling of State and TransitionsThe
invoke
method is the main composable function that handles the stack animations. It properly manages the state and transitions of the child stack. However, ensure that all edge cases are handled, especially with thepredictiveBackParams
.Verification successful
Proper Handling of
predictiveBackParams
VerifiedThe
predictiveBackParams
is appropriately managed within theDefaultStackAnimation.kt
andStackAnimation.kt
files. The code ensures proper initialization, usage, and disposal, covering potential edge cases effectively.
DefaultStackAnimation.kt
: Initialization, usage in composable functions, and disposal viaDisposableEffect
.StackAnimation.kt
: Initialization and passing of parameters.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of predictiveBackParams and ensure edge cases are handled. # Test: Search for the usage of predictiveBackParams. Expect: Proper handling in all cases. rg --type kotlin 'predictiveBackParams'Length of output: 4139
Script:
#!/bin/bash # Extract relevant code sections around predictiveBackParams in DefaultStackAnimation.kt and StackAnimation.kt # Extract lines around predictiveBackParams in DefaultStackAnimation.kt rg --context 5 --type kotlin 'predictiveBackParams' extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt # Extract lines around predictiveBackParams in StackAnimation.kt rg --context 5 --type kotlin 'predictiveBackParams' extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.ktLength of output: 5286
200-281
: PredictiveBackCallback Inner Class Looks GoodThe
PredictiveBackCallback
inner class handles the predictive back gestures. It properly manages the transition states and animations during back events. Ensure that all edge cases are handled, especially with theanimatable
property.Verification successful
PredictiveBackCallback Inner Class Looks Good
The
PredictiveBackCallback
inner class handles the predictive back gestures effectively. Theanimatable
property is properly managed with null-checks and appropriate cleanup in all relevant methods.
onBackStarted
: Setsanimatable
and uses it with null-checks.onBackProgressed
: Usesanimatable
with null-checks.onBackCancelled
: Cancelsanimatable
and resets it.onBack
: Finishesanimatable
and resets it.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of animatable property in PredictiveBackCallback. # Test: Search for the usage of animatable. Expect: Proper handling in all cases. rg --type kotlin 'animatable'Length of output: 4485
Script:
#!/bin/bash # Description: Gather context around the usage of animatable in DefaultStackAnimation.kt. # Extract lines around the usage of animatable to verify proper handling. rg --type kotlin --context 5 'animatable' extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.ktLength of output: 3256
extensions-compose-experimental/api/extensions-compose-experimental.klib.api (10)
9-11
: StackAnimation Interface Looks GoodThe
StackAnimation
interface defines theinvoke
method for stack animations. The method signature is clear and appropriate.
13-15
: StackAnimator Interface Looks GoodThe
StackAnimator
interface defines theanimate
method for animating visibility scopes. The method signature is clear and appropriate.
17-19
: StackAnimationProvider Interface Looks GoodThe
StackAnimationProvider
interface defines theprovide
method for providing stack animations. The method signature is clear and appropriate.
21-30
: PredictiveBackParams Class Looks GoodThe
PredictiveBackParams
class holds the parameters for predictive back gestures, including the back handler, onBack function, and animatable selector. The constructor and properties are clear and appropriate.
32-33
: LocalStackAnimationProvider Property Looks GoodThe
LocalStackAnimationProvider
property provides a composition local for theStackAnimationProvider
. The getter method is clear and appropriate.
34-36
: Stable Property Constants Look GoodThe stable property constants for
DefaultStackAnimation
,DefaultStackAnimator
, andPredictiveBackParams
are defined appropriately.
38-49
: StackAnimator Extension Functions Look GoodThe extension functions for
StackAnimator
provide additional functionality, including combining animators and creating specific animations like fade, scale, and slide. The method signatures are clear and appropriate.
41-42
: ChildStack Extension Functions Look GoodThe extension functions for
ChildStack
provide additional functionality for creating child stacks with animations. The method signatures are clear and appropriate.
43-45
: Stable Property Getter Functions Look GoodThe stable property getter functions for
DefaultStackAnimation
,DefaultStackAnimator
, andPredictiveBackParams
are defined appropriately.
46-49
: Animation Creation Functions Look GoodThe functions for creating specific animations like fade, scale, slide, and stackAnimator are defined appropriately. The method signatures are clear and appropriate.
...src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/Utils.kt
Show resolved
Hide resolved
...arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (30)
- extensions-compose-experimental/.gitignore (1 hunks)
- extensions-compose-experimental/api/android/extensions-compose-experimental.api (1 hunks)
- extensions-compose-experimental/api/extensions-compose-experimental.klib.api (1 hunks)
- extensions-compose-experimental/api/jvm/extensions-compose-experimental.api (1 hunks)
- extensions-compose-experimental/build.gradle.kts (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/SimpleAnimatedVisibilityScope.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/Utils.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimator.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/EmptyStackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Fade.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/PredictiveBackParams.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Scale.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationProvider.kt (1 hunks)
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimator.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStackTest.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/GetFadeAlphaTest.kt (1 hunks)
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt (1 hunks)
- extensions-compose/build.gradle.kts (1 hunks)
- extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt (3 hunks)
- sample/shared/compose/build.gradle.kts (2 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (1 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (4 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt (4 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/DefaultSharedTransitionsComponent.kt (1 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsComponent.kt (1 hunks)
- settings.gradle.kts (1 hunks)
Files skipped from review due to trivial changes (3)
- extensions-compose-experimental/.gitignore
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/Utils.kt
- settings.gradle.kts
Files skipped from review as they are similar to previous changes (25)
- extensions-compose-experimental/api/android/extensions-compose-experimental.api
- extensions-compose-experimental/api/extensions-compose-experimental.klib.api
- extensions-compose-experimental/api/jvm/extensions-compose-experimental.api
- extensions-compose-experimental/build.gradle.kts
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/SimpleAnimatedVisibilityScope.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimation.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/DefaultStackAnimator.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/EmptyStackAnimation.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Fade.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/PredictiveBackParams.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Scale.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/Slide.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimation.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationProvider.kt
- extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimator.kt
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStackTest.kt
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/GetFadeAlphaTest.kt
- extensions-compose-experimental/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/animation/StackAnimationDirectionsTest.kt
- extensions-compose/build.gradle.kts
- sample/shared/compose/build.gradle.kts
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/DefaultSharedTransitionsComponent.kt
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsComponent.kt
Additional comments not posted (9)
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/stack/ChildStack.kt (5)
34-52
: Ensure correct usage ofAnimatedVisibilityScope
.The function correctly uses
AnimatedVisibilityScope
to enable additional animations. Ensure that the scope is used appropriately in thecontent
composable function.
68-82
: LGTM!The function correctly subscribes to the state and delegates to the first overload of
ChildStack
.
84-85
: LGTM!The function correctly retrieves the keys of the child components.
88-101
: LGTM!The function correctly retains the states of the child components and removes states that are no longer in the current keys.
104-106
: LGTM!The class correctly holds a set of keys and is used appropriately in the
retainStates
function.extensions-compose/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/StackAnimationDirectionsTest.kt (4)
Line range hint
31-60
:
LGTM!The function correctly initializes the
results
map, sets up the animation, and asserts the expected results.
Line range hint
62-66
:
LGTM!The function correctly creates a
ChildStack
with the active child and back stack.
Line range hint
68-71
:
LGTM!The function correctly creates a
Child.Created
with the given configuration and instance.
80-105
: LGTM!The companion object correctly provides test parameters and the
Params
class correctly holds the test parameters.
Fixes #690.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests