Skip to content

Enhancement/892 optimize all screen transition animation#893

Merged
SorrowBlue merged 3 commits intomainfrom
enhancement/892-optimize-all-screen-transition-animation
Sep 20, 2025
Merged

Enhancement/892 optimize all screen transition animation#893
SorrowBlue merged 3 commits intomainfrom
enhancement/892-optimize-all-screen-transition-animation

Conversation

@SorrowBlue
Copy link
Copy Markdown
Owner

@SorrowBlue SorrowBlue commented Sep 20, 2025

Fixes #892

@SorrowBlue SorrowBlue requested a review from Copilot September 20, 2025 10:10
@SorrowBlue SorrowBlue self-assigned this Sep 20, 2025
@SorrowBlue SorrowBlue linked an issue Sep 20, 2025 that may be closed by this pull request
@github-actions github-actions Bot added the type: 🚀enhancement 「既存機能の改善」[Improvements to existing functions] label Sep 20, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances screen transition animations across the ComicViewer application by refactoring the navigation transition system and introducing shared element transitions for improved visual continuity.

Key changes:

  • Refactored transition configuration system with new BetweenScreen and GraphFrom types
  • Added SharedAxisZ transition type and consolidated transition parameters
  • Implemented shared element transitions for file thumbnails and book screens
  • Reorganized module structure by replacing data:di with aggregation module

Reviewed Changes

Copilot reviewed 39 out of 42 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
settings.gradle.kts Added aggregation module and removed data:di module reference
framework/ui/.../DestinationTransitions.kt Refactored transition system with new configuration types and Z-axis support
framework/ui/.../Transition.kt Simplified transition functions and added SharedAxisZ animations
feature/*/navigation/*Transitions.kt Updated all nav graph transitions to use new configuration types
feature/file/component/*.kt Added shared element transitions for file thumbnails
feature/book/BookScreen.kt Implemented shared element transition for book viewer
aggregation/ New module consolidating navigation transitions and DI configuration


TransitionsConfigure.Type.FadeThrough -> materialFadeThroughIn()
TransitionsConfigure.Type.ContainerTransform -> materialContainerTransformIn()
logcat { "***route enterTransition ${initRoute.route} ${targetRoute.route}" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***route enterTransition ${initRoute.route} ${targetRoute.route}" }

Copilot uses AI. Check for mistakes.
}
}
}?.let {
logcat { "***** enterTransition $it" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***** enterTransition $it" }

Copilot uses AI. Check for mistakes.
TransitionsConfigure.Type.SharedAxisY -> materialSharedAxisYOut(true, slideDistance)
TransitionsConfigure.Type.FadeThrough -> materialFadeThroughOut()
TransitionsConfigure.Type.ContainerTransform -> materialContainerTransformOut()
logcat { "***route exitTransition ${initRoute.route} ${targetRoute.route}" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Copilot uses AI. Check for mistakes.
}
}
}?.let {
logcat { "***** exitTransition $it" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***** exitTransition $it" }

Copilot uses AI. Check for mistakes.
TransitionsConfigure.Type.SharedAxisY -> materialSharedAxisYIn(true, slideDistance)
TransitionsConfigure.Type.FadeThrough -> materialFadeThroughIn()
TransitionsConfigure.Type.ContainerTransform -> materialContainerTransformIn()
logcat { "***route popEnterTransition ${initRoute.route} ${targetRoute.route}" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***route popEnterTransition ${initRoute.route} ${targetRoute.route}" }

Copilot uses AI. Check for mistakes.
return transitions.firstOrNull { conf ->
(conf.exitRoute == null && initRoute.hierarchy.any { it.hasRoute2(conf.enterRoute) }) ||
(initRoute.hasRoute2(conf.exitRoute) && targetRoute.hasRoute2(conf.enterRoute))
logcat { "***route popExitTransition ${initRoute.route} ${targetRoute.route}" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***route popExitTransition ${initRoute.route} ${targetRoute.route}" }

Copilot uses AI. Check for mistakes.
}
}
}?.let {
logcat { "***** popExitTransition $it" }
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug logging statements should be removed from production code. These logcat calls will impact performance and clutter logs in release builds.

Suggested change
logcat { "***** popExitTransition $it" }

Copilot uses AI. Check for mistakes.
filterQuality = filterQuality,
onError = { isError = true },
onSuccess = { isError = false },
with(LocalAppState.current) {
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared element transition implementation should be extracted to avoid nesting the entire component inside with(LocalAppState.current). Consider creating a wrapper composable or extracting the shared bounds logic.

Copilot uses AI. Check for mistakes.
)
} else {
GridFileIcon(file = file)
with(LocalAppState.current) {
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to ListFile, the shared element transition implementation should be extracted to avoid nesting the entire component inside with(LocalAppState.current). Consider creating a wrapper composable or extracting the shared bounds logic.

Copilot uses AI. Check for mistakes.
Comment on lines +143 to +154
with(LocalAppState.current) {
Surface(
modifier = Modifier.fillMaxSize()
.sharedBounds(
rememberSharedContentState("${route.bookshelfId}:${route.path}"),
LocalAnimatedContentScope.current,
enter = materialFadeThroughIn(),
exit = materialFadeThroughOut(),
boundsTransform = { _, _ -> ExpressiveMotion.Spatial.slow() },
resizeMode = scaleToBounds(ContentScale.Fit, Center),
)
) {
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared element transition wrapping should be extracted to avoid nesting the entire screen content inside with(LocalAppState.current). Consider creating a shared element wrapper composable to improve code organization and reusability.

Copilot uses AI. Check for mistakes.
@SorrowBlue SorrowBlue merged commit 33bab5b into main Sep 20, 2025
22 checks passed
@SorrowBlue SorrowBlue deleted the enhancement/892-optimize-all-screen-transition-animation branch September 20, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: 🚀enhancement 「既存機能の改善」[Improvements to existing functions]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize all screen transition animation

2 participants