-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SnackBar] Handle anchor view properly so no memory leak will happen
The anchor view can be detached even when the snack bar (or any transient bottom bar) is showing. If this situation happens the global layout listener it registers with the anchor view will become not removable due to a bug/intended behavior of Android View's implementation. We need to remove the listener when the anchor view is detached to fix the issue. This CL also refactors the whole implementation of anchor view and consolidates the anchoring/unanchoring logic to improve readability and robustness of it. Resolves #2042 PiperOrigin-RevId: 382603130
- Loading branch information
Showing
1 changed file
with
93 additions
and
25 deletions.
There are no files selected for viewing
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