conradchen 35d9da8f67 [SnackBar] Fix NPE on Android 8 & 9
It seems like on Android 8 & 9 framework's View implementation has a bug that under certain scenarios if we set a view's visibility when view.getParent() is null, it can cause NPE crash.

Fixes this by switching the order of addView and setVisibility() call.

Resolves https://github.com/material-components/material-components-android/issues/917

PiperOrigin-RevId: 413978332
2021-12-06 19:46:57 +00:00
..