-
Notifications
You must be signed in to change notification settings - Fork 213
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 the code for the left scroll animation. #997
Closed
Jhalakupadhyay
wants to merge
7
commits into
fossasia:flutter_app
from
Jhalakupadhyay:feature/left_animation
Closed
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4a85f72
feat: Added the logic to display the clipart and text on the virtual …
Jhalakupadhyay 2b799cc
feat:Added the base structure for the animations with speed controll.
Jhalakupadhyay 2d35016
feat: Added the logic to display the user drawn clipart to the badge.…
Jhalakupadhyay 87ab10d
feat: Added the logic to display the clipart and text on the virtual …
Jhalakupadhyay d8b3c1a
feat:Added the base structure for the animations with speed controll.
Jhalakupadhyay 2d8ae62
feat: added the left animation.
Jhalakupadhyay 202b49a
Merge branch 'flutter_app' into feature/left_animation
Jhalakupadhyay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
extensions: | ||
- provider: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:badgemagic/bademagic_module/utils/byte_array_utils.dart'; | ||
import 'package:cancellation_token/cancellation_token.dart'; | ||
|
||
class TokenGenerator { | ||
//make the class singleton | ||
static final TokenGenerator _instance = TokenGenerator._internal(); | ||
factory TokenGenerator() => _instance; | ||
TokenGenerator._internal(); | ||
|
||
CancellationToken token = CancellationToken(); | ||
|
||
//getter for the token | ||
CancellationToken get getToken => token; | ||
|
||
void refreshToken() { | ||
token.cancel(); | ||
logger.i("Token status: ${token.isCancelled}"); | ||
token = CancellationToken(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:badgemagic/badge_animation/animation_abstract.dart'; | ||
|
||
class RightAnimation extends BadgeAnimation { | ||
@override | ||
void animation( | ||
List<List<bool>> grid, | ||
List<List<int>> newGrid, | ||
int animationIndex, | ||
bool validMarquee, | ||
bool flashLEDOn, | ||
int currentcountFrame, | ||
int i, | ||
int j, | ||
int newHeight, | ||
int newWidth, | ||
int badgeHeight, | ||
int badgeWidth) { | ||
// Get the corresponding column in the new grid based on the scroll positio | ||
int sourceCol = j; | ||
|
||
// If sourceCol is negative, display blank space (off-screen part of the grid) | ||
if (sourceCol >= 0 && sourceCol < newWidth) { | ||
// Ensure flashLEDOn and validMarquee effects are applied | ||
grid[i][j] = | ||
validMarquee || flashLEDOn && newGrid[i % newHeight][sourceCol] == 1; | ||
} else { | ||
grid[i][j] = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
abstract class BadgeAnimation { | ||
void animation( | ||
List<List<bool>> grid, | ||
List<List<int>> newGrid, | ||
int animationIndex, | ||
bool validMarquee, | ||
bool flashLEDOn, | ||
int currentcountFrame, | ||
int i, | ||
int j, | ||
int newHeight, | ||
int newWidth, | ||
int badgeHeight, | ||
int badgeWidth); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
suggestion (performance): Simplify and optimize binaryStringTo2DList function
The current implementation uses complex nested loops. Consider rewriting this function to use a single loop with index manipulation for better efficiency and readability.