Commit 2bfc7ba
[SnackBar] Fix margins are added multiple times when show() is called
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)1 parent d6cd0e6 commit 2bfc7ba
File tree
1 file changed
+12
-2
lines changed- lib/java/com/google/android/material/snackbar
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
| 715 | + | |
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
1114 | 1115 | | |
1115 | 1116 | | |
1116 | 1117 | | |
| |||
1233 | 1234 | | |
1234 | 1235 | | |
1235 | 1236 | | |
1236 | | - | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1237 | 1241 | | |
1238 | 1242 | | |
1239 | 1243 | | |
| |||
1266 | 1270 | | |
1267 | 1271 | | |
1268 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1269 | 1279 | | |
1270 | 1280 | | |
1271 | 1281 | | |
| |||
0 commit comments