Skip to content

Commit

Permalink
[BottomAppBar] Request layout for FAB when BAB changes so that FAB wi…
Browse files Browse the repository at this point in the history
…ll always be aware of BAB changes

PiperOrigin-RevId: 492023349
  • Loading branch information
imhappi authored and leticiarossi committed Dec 1, 2022
1 parent 3dbffd3 commit 4bdfb8b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,12 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
cancelAnimations();

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

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

0 comments on commit 4bdfb8b

Please sign in to comment.