Skip to content

Commit 10fe695

Browse files
imhappidsn5ft
authored andcommitted
[BottomAppBar] Request layout for FAB when BAB changes so that FAB will always be aware of BAB changes
PiperOrigin-RevId: 492023349 (cherry picked from commit 4bdfb8b)
1 parent 83e045e commit 10fe695

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/java/com/google/android/material/bottomappbar/BottomAppBar.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,12 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
11881188
cancelAnimations();
11891189

11901190
setCutoutStateAndTranslateFab();
1191+
// If the BAB layout has changed, we should alert the fab so that it can
1192+
// adjust its margins accordingly.
1193+
View dependentView = findDependentView();
1194+
if (dependentView != null && ViewCompat.isLaidOut(dependentView)) {
1195+
dependentView.post(() -> dependentView.requestLayout());
1196+
}
11911197
}
11921198

11931199
// Always ensure the MenuView is in the correct position after a layout.

0 commit comments

Comments
 (0)