-
-
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
Updated shared transitions sample #798
Conversation
WalkthroughThe pull request introduces enhancements to the predictive back animation functionality within the Changes
Possibly related PRs
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 using PR comments)
Other keywords and placeholders
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: 0
🧹 Outside diff range and nitpick comments (2)
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (1)
45-48
: LGTM! Consider minor formatting adjustment.The update from
.sharedElement(...)
to.sharedBounds(...)
and the parameter name change fromstate
tosharedContentState
appear to be correct and consistent with the new API. These changes likely improve the clarity and functionality of shared transitions.For better readability, consider aligning the parameters vertically:
.sharedBounds( sharedContentState = rememberSharedContentState(key = image.id), animatedVisibilityScope = animatedVisibilityScope, )sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (1)
Line range hint
17-41
: Overall, good enhancement to predictive back animation.The changes successfully introduce Material Design-specific predictive back animation to the
SharedTransitionsContent
composable. This improvement aligns well with the PR objectives and should enhance the user experience.As a minor suggestion, consider adding a brief comment explaining the purpose of the
materialPredictiveBackAnimatable
function for future maintainability.You could add a comment like this above the
PredictiveBackParams
instantiation:// Use Material Design-specific animatable for predictive back animation PredictiveBackParams( // ... existing parameters ... animatable = ::materialPredictiveBackAnimatable, )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (2 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (1 hunks)
- sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt (1 hunks)
🧰 Additional context used
🔇 Additional comments (4)
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/photo/PhotoContent.kt (1)
35-38
: LGTM! Verify transition behavior with new API.The update from
.sharedElement(...)
to.sharedBounds(...)
aligns with the PR objectives of updating the shared transitions sample. The use ofrememberSharedContentState(key = component.image.id)
is a good practice for maintaining state consistency across recompositions.Please verify that:
- The transition behavior works as expected with
renderInOverlayDuringTransition = false
.- The performance is not negatively impacted by these changes.
You may want to test different scenarios to ensure the shared transition still functions correctly with these API updates.
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/gallery/GalleryContent.kt (1)
45-48
: Verify API change consistency across the codebase.The change from
.sharedElement(...)
to.sharedBounds(...)
appears to be part of a larger API update. It's important to ensure this change has been applied consistently across the entire codebase.Run the following script to check for any remaining instances of
.sharedElement(...)
that might need updating:If any results are returned, please review those files and update them accordingly.
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/sharedtransitions/SharedTransitionsContent.kt (2)
17-17
: LGTM: New import for predictive back animation.The addition of
materialPredictiveBackAnimatable
import is appropriate. This function will be used to enhance the predictive back animation functionality, specifically for Material Design-based animations.
39-41
: LGTM: Enhanced predictive back animation.The addition of the
animatable
parameter toPredictiveBackParams
with::materialPredictiveBackAnimatable
is a good improvement. This change enhances the predictive back animation by providing a specific Material Design-based animatable function, which should result in a more polished and consistent user experience.
Summary by CodeRabbit