-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Refactor FAB with onScroll animation #1475
Refactor FAB with onScroll animation #1475
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.
Thanks for the submission! I am just checking with our designer whether this meets the Material spec that this sample is demonstrating
One minor comment as well, there is an easier way to determine if the fab should be expanded
) | ||
} | ||
contentColor = MaterialTheme.colorScheme.onTertiaryContainer, | ||
expanded = emailLazyListState.isScrollingUp() |
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.
No need for an extension here, you can replace this with
expanded = emailLazyListState.isScrollingUp() | |
expanded = emailLazyListState.lastScrolledBackward || | |
!emailLazyListState.canScrollBackward |
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.
Thank you! I really appreciate it. It's been exciting to try Android development again after 4 years! I've updated as per suggestion.
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!
Looks like it just needs formatting. You should be able to just run
|
I've applied spotless to format the code. |
The large FAB looks weird with the design. So I've refactored it to use Extended FAB and added animation onScroll like Gmail does.
New:
Old:
We can also consider showing/hiding the Search Bar & Bottom Navigation Bar on the scroll. I will try to do it next if this PR gets merged.
Thank you.