Skip to content
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] Each show() call adds an extra bottom indent #2666

Closed
pubiqq opened this issue Apr 26, 2022 · 1 comment
Closed

[Snackbar] Each show() call adds an extra bottom indent #2666

pubiqq opened this issue Apr 26, 2022 · 1 comment

Comments

@pubiqq
Copy link
Contributor

pubiqq commented Apr 26, 2022

How to reproduce:

  • Create a Snackbar object
  • Call show() on this object
  • Wait for the snackbar to disappear
  • Call show() on this object again
  • Notice that the snackbar appeared higher than the previous time

Here's how it can be reproduced in DatePickerMainDemoFragment:

8174368891.mp4

Material Library version: 1.6.0-rc01

@dsn5ft
Copy link
Contributor

dsn5ft commented Apr 26, 2022

@drchen can you check if this is a regression caused by d5856fd? I remember handling this case in the original implementation of Snackbar margins.

@dsn5ft dsn5ft added the P1 label Apr 26, 2022
@dsn5ft dsn5ft closed this as completed in 46fa8cc Apr 28, 2022
dsn5ft pushed a commit that referenced this issue May 4, 2022
When a snack bar is hidden and its show() method is called, it will be added to the target parent, and at this moment the parent view will set the layout params to the snack bar, with the same existing margins if any. Therefore if the margins are already updated with extra margins, the original margins will be incorrectly updated. This CL introduces a flag to tells this situation from other "real" scenarios in which clients want to update their custom margins.

Resolves #2666

PiperOrigin-RevId: 445159923
(cherry picked from commit 46fa8cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants