-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Toast polish #508
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
fix: Toast polish #508
Conversation
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.
Pull request overview
This PR implements a queue management system for toasts to ensure sequential display and improves the horizontal dismiss swipe animation. The changes introduce a dedicated ToastQueueManager class that handles toast queuing with pause/resume capabilities, replacing the previous single-toast state management.
Key Changes:
- Introduced
ToastQueueManagerclass to handle toast queue with a maximum size of 5, sequential display, and pause/resume functionality - Refactored
AppViewModelto useToastQueueManagerinstead of direct state management - Enhanced horizontal swipe dismiss animation in
ToastViewto complete the off-screen animation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
ToastQueueManager.kt |
New class implementing queue logic with auto-hide timers, pause/resume support, and sequential toast display |
AppViewModel.kt |
Refactored to delegate toast management to ToastQueueManager with new pause/resume/clear methods |
ToastView.kt |
Enhanced horizontal swipe dismiss to animate toast off-screen before dismissing |
MainActivity.kt |
Updated to collect toast as StateFlow and wire up pause/resume callbacks |
ovitrif
left a comment
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.
tACK
Approved with some nits for code cleanup.
Very nice solution 👏🏻
app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt
Outdated
Show resolved
Hide resolved
|
@jvsena42 FYI I'm also working on a fix to resolve planning to land it in: |
Thanks! on this case, assign the issue to yourself could prevent someone else take it |
ovitrif
left a comment
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.
LGTM 👏🏻
closes #505
Description
This PR implements a queue logic to toasts and fixes the horizontal dismiss wipe animation
Preview
different-toasts.webm
same-toast-type.webm
QA Notes
For mock: