-
Notifications
You must be signed in to change notification settings - Fork 241
feat: Added Back and forth animation #1441
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
feat: Added Back and forth animation #1441
Conversation
Reviewer's GuideIntroduces a new back-and-forth cycle (bicycle) animation mode with smooth looping by implementing a CycleAnimation subclass, integrating it into mode and animation mappings, adding a dedicated transferCycleAnimation function, and updating the UI for mode selection. Class diagram for the new CycleAnimation and related changesclassDiagram
class BadgeAnimation {
<<abstract>>
+processAnimation()
}
class CycleAnimation {
+transferFrames()
+processAnimation()
-_calculateCycleX()
-_easeInOut()
-_shouldFlipCycle()
-_calculateWheelBounce()
-_drawCycle()
static cycleMatrix
static badgeHeight
static badgeWidth
static cycleHeight
static cycleWidth
static framesPerCycle
static previewFramesPerCycle
}
BadgeAnimation <|-- CycleAnimation
class BadgeMessageProvider {
+transferCycleAnimation()
}
class AnimationBadgeProvider {
+isSpecialAnimationSelected()
+calculateDuration()
+transferCycleAnimation()
}
CycleAnimation <.. BadgeMessageProvider : uses
CycleAnimation <.. AnimationBadgeProvider : uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- In transferCycleAnimation you’re still using Mode.fixed for the messages—switch to Mode.cycle so the badge receives the correct animation mode.
- The frame conversion and message-building code in transferCycleAnimation largely duplicates other transfer functions—extract it into a shared helper to reduce repetition.
- The hard-coded transfer frame indices in ani_cycle.dart are opaque—move them into named constants or add a comment explaining why those specific frames were chosen.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In transferCycleAnimation you’re still using Mode.fixed for the messages—switch to Mode.cycle so the badge receives the correct animation mode.
- The frame conversion and message-building code in transferCycleAnimation largely duplicates other transfer functions—extract it into a shared helper to reduce repetition.
- The hard-coded transfer frame indices in ani_cycle.dart are opaque—move them into named constants or add a comment explaining why those specific frames were chosen.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Build StatusBuild successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/17546998316/artifacts/3952271588. Screenshots |
@nope3472 Please respond to sourcery-ai and adjust where applicable. |
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.
Please also resolve conflicts.
@nope3472 can you resolve the conflict here? I also asked you last week on chat, we want to test the scrolling feature |
okay will do it |
@hpdang resolved the conflicts |
Fixes #892
Changes
Screenshots / Recordings
Checklist:
constants.dart
without hard coding any value.Summary by Sourcery
Add a seamless cycle animation feature by introducing CycleAnimation, wiring it through mode maps, animation provider, transfer logic, and UI controls, and ensuring smooth looping and empty-text handling for the bicycle effect.
New Features:
Enhancements: