-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Snackbar] FAB shortly jumps up, before the Snackbar slides in from the bottom #851
Comments
https://material.io/components/snackbars/#behavior According to the material design spec, Snackbar should be displayed above the FAB, not below. |
Oups. You're right. I was absolutely sure the floating button should flow up and stay above the snackbar. Maybe because it looks super-ugly otherwise 😄 Closing the issue. |
I've find out a hack.
And in your layout
Of course rootview must be CoordinatorLayout |
@leeroyhero This is great! Just one issue. If you swipe the snackbar away, the FAB doesn't come back down. Just also override |
Description: As it can be seen in the 2 second of this video, which shows 3x slowed down Snackbar's slide-in animation, right before the FAB button get pushed up, it shortly jumps up (which is wrong) and only then gets pushed as expected. It looks there are just few drawing frames where the FAB is misplaced, but the effect is visually unpleasant.
Expected behavior: FAB button follows the slide-in movement of the Snackbar and doesn't jump.
Source code: Complete app can be cloned and imported from github.com/beworker/edge-to-edge. Once launched, the misbehaving example is "Toolbar + RecyclerView + FAB in CoordinatorLayout" one.
Layout: https://github.com/beworker/edge-to-edge/blob/master/app/src/main/res/layout/fragment_toolbar_with_scrollable_content_and_fab.xml
Fragment: https://github.com/beworker/edge-to-edge/blob/master/app/src/main/java/de/halfbit/edgetoedge/sample/examples/ToolbarWithScrollableContentAndFab.kt
Note: The issue can also be reproduced without
edgeToEdge { }
block, which can be removed completely.Android API version: Reproduced with Android 10 on the emulator.
Material Library version: 1.2.0-alpha03 (latest)
Device: The Android Emulator.
The text was updated successfully, but these errors were encountered: